Re: calling COM objects from PHP

From: Date: Tue, 28 Aug 2001 00:34:06 +0000
Subject: Re: calling COM objects from PHP
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-9084@lists.php.net to get a copy of this message
Try: $webamp = New COM("WebAmp.WebAmpCtl") or die ("Could not create COM object"); $filename = $webamp->sFilename; Sometimes it works better... Otherwise, what is the value of $filename that you are expecting? Alain On Tue, Aug 28, 2001 at 12:24:48AM +0100, Haemish Graham wrote: > 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 > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#9084) next »