Re: Using DLL with PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 9, 2009 at 11:10 AM, Dan Shirah <mrsquash2@xxxxxxxxx> wrote:
>>
>> Check out the com [www.php.net/com] functionality
>>
>> Bastien
>>
> Alrighty, I'm trying to use the COM function, but not getting much of
> anywhere.
>
> This is what I have:
>
> <?php
> // The VB function for reference
> /*function DTM_CONVDMSToMultiTIFF Lib "D32_CONV.DLL" _
> (ByVal FullPathFrom As String, ByVal FullPathTo As String) As Integer*/
>
> //Create a function in PHP to call the DLL
> function DMStoTIFF() {
> $my_com = new COM('D32_CONV.DLL');
> $output = $my_com->DTM_CONVDMSToMultiTIFF("C:\TEST\04186177.dms",
> "C:\TEST\04186177.tiff");
> }
> DMStoTIFF();
> ?>
>
> But I am getting the error below:
>
> *Fatal error*: Uncaught exception 'com_exception' with message 'Failed to
> create COM object `D32_CONV.DLL': Invalid syntax
>
> Any ideas?
>

I can't help much, but this might get you started.

1) Does the DLL you are trying to use actually supports COM. I know some don't.

2) I'm pretty sure that the string you pass to new COM('...') should
be the name the class as registered with Windows, not the actual file
name. They are usually something like 'Scripting.FileSystemObject',
'word.application', 'ADODB.Recordset', etc.



Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux