calling COM objects from PHP
| From: | Haemish Graham | Date: | Mon, 27 Aug 2001 23:24:48 +0000 |
| Subject: | calling COM objects from PHP | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-9081@lists.php.net to get a copy of this message | ||
Hi.
I wrote a COM object today that returns the filename of the current winamp track running on my machine but do not seem to be able to get PHP to return the filename property. I tested my COM object using a stand alone VB script and a ColdFusion script with IIS, and it all worked. However running Apache and PHP (4.06) on a Windows 2000 box I get the following results:
----------8<----------8<----------8<----------8<----------
<?php
print "PHP version ". phpversion()."<br>\n";
$webamp = com_load( "WebAmp.WebAmpCtl" ) or die ("Could not create COM object");
$filename = com_get( $webamp, "sFilename" ) or die ("Could not get COM property");
$webamp = NULL;
?>
----------8<----------8<----------8<----------8<----------
PHP version 4.0.6
Warning: Error in php_OLECHAR_to_char() in d:\clients\haemish\index.html on line 46
Could not get COM property
----------8<----------8<----------8<----------8<----------
Does any one know just how reliable the COM interface is in PHP or if there are any tweaks that have to be done to the COM object. The COM object is written in VC++ 6.0 and I am quite happy to share the source if it will help solve the problem (although there really is not much there yet:)
Cheers.
-haemish