RE: Using DLL with PHP

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

 



> -----Original Message-----
> From: Andrew Ballard [mailto:aballard@xxxxxxxxx]
> Sent: Monday, February 09, 2009 11:21 AM
> To: Dan Shirah
> Cc: Phpster; PHP-General list
> Subject: Re:  Using DLL with PHP
> 
> On Mon, Feb 9, 2009 at 12:10 PM, Dan Shirah <mrsquash2@xxxxxxxxx>
> wrote:
> >> 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
> >
> > The DLL I am trying to work with was written by an outside agency.
> >
> > Their application uses this dll to convert DMS images (Their
> proprietary
> > format) to TIFF images.
> >
> > Naturally they are not very forth coming to share the functionality
> of their
> > software, but I was able to get the VB function that calls the DLL
> for
> > conversion.
> >
> > Private Declare Function DTM_CONVDMSToMultiTIFF Lib "D32_CONV.DLL" _
> >             (ByVal FullPathFrom As String, ByVal FullPathTo As
> String) As
> > Integer
> >
> > So, I was hoping to be able to call that DLL in PHP and pass it the
> two
> > values I specify in my application.
> >
> > In order to be used by COM is the DLL required to be placed in the
> SYSTEM or
> > SYSTEM32 folder?
> 
> No. When I was doing an ASP (not .NET) site, we registered them from a
> custom path just for our web app.
> 
> > Or does it have to be a DLL that can be registered?
> 
> I believe you do have to register it with regsvr32 for it to be
> visible.
> 
> I think the GUID that Todd mentioned might even work, but I've only
> ever used the ProgID. If you don't know the ProgID that is registered,
> you should be able to find it in the Windows registry after you've
> registed it with regsvr32. If you search for the file name, it should
> find an entry somewhere under \HKEY_CLASSES_ROOT\CLSID\(some
> GUID)\InprocServer32 that has a value of the full path to your DLL
> file. The ProgID is the next key down below InprocServer32, labeled
> aptly "ProgID".

I believe that the GUID will only be used to look-up class libraries that have already been registered (either via regsvr32 or via the Global Assembly Cache in c:\Windows\Assembly). I believe your ProgID suggestion will work just fine for pre-.NET DLLs, anyway. :)


// Todd


[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