Hey all,
I’m pretty new here, but from the looks of it, this seems like a pretty lively community! Anyway, to my question… I have recently undergone days of stress and headache trying to get a .dll assembly file, originally written in C#, to register and become “COM-ready”. Below are the steps I’ve taken to do this. My main issue is (given I’ve done all the necessary steps for the third-party .dll) how do I use the PHP COM class to use the .dll’s class methods?
Steps I’ve Taken:
-
I heard I needed to give the third-party .dll assembly file a strong name key. In order to do this, I had to dissemble and reassemble (using the command-line tool ildasm.exe) the .dll (“3party.dll”) and add the strong name key using the command-line tool (sn.exe) – “sn –k mykey.snk”
-
After that, I had to register the assembly using the Assembly Registration Tool (regasm.exe). After using this tool, it created a .tlb file (“3party.tlb”).
-
Following the registration, I found that needed to add the assembly to the GAC (Global Assembly Cache) using the gacutil.exe. This added the file to the assembly folder on my computer (C:\Windows\Microsoft.NET\assembly).
What Do I Do Now?
Assuming I’ve performed all the necessary preliminary steps to using a third-party C# .dll assembly file as a COM object in PHP, what do I need to do to call this .dll file and use it within my PHP code? I’ve tried commands like:
[php]$myDllObj = new COM(“3party.dll”);[/php]
to no avail…
Also, with it being a third-party .dll… and the COM class object requiring parameters: COM(Application.ID)… given just the .dll assembly name (“3party”) and the methods associated with the .dll file, how do I find the “Application.ID”? I also read it takes either a ProdID, CLSID (classID), or a Moniker… If that’s the case, how do I find these values as well so I can use this in the PHP code and call the methods in the .dll file.
Anyway, with my lack in both PHP knowledge and all-things-assemblies, I’ve been having an extremely hard time trying to get even this far. Hopefully, someone can help me resolve this issue.
Thanks in advance.