note 42115 added to function.com-load-typelib
| From: | php-general at lists dot php dot net | Date: | Mon, 03 May 2004 23:18:04 +0000 |
| Subject: | note 42115 added to function.com-load-typelib | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69179@lists.php.net to get a copy of this message | ||
In case any of you were wondering what com_load_typelib actually DOES, I have found that it loads
constants\enums that the COM obeject has defined. The example below is using the Nero COM object
(from Nero Burning rom, version 6+). The Nero object defines a bunch of constants, but they can not
be used as PHP constants unless you use the mentioned function. So the example below will work just
fine:
<?php
$aNero = new COM("Nero.Nero") or die ("Nero didn't load, too bad");
com_load_typelib("Nero.Nero");
$aNero->GetDrives(NERO_MEDIA_CD);
?>
But this one will not, since PHP will return a message saying that the constant is undefined:
<?php
$aNero = new COM("Nero.Nero") or die ("Nero didn't load, too bad");
$aNero->GetDrives(NERO_MEDIA_CD);
?>
This one took me a while to figure out, hope it helps.
Also, check out http://www.php.net/manual/en/faq.com.php to find
out how to get COM events working in PHP.
----
Manual Page -- http://www.php.net/manual/en/function.com-load-typelib.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42115
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42115&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42115&report=yes
Search -- http://master.php.net/manage/user-notes.php