2

I'm trying to access my COM object (in registered DLL) from PHP.

It is possible to access this COM Object from other application (using tlb file), but as I'm not PHP developer, I've experienced issues with accessing it from PHP. I've tried to access it using

$com = new COM('ITestCOMClass');

but as result only Failed to create COM objectITestCOMClass':` appears. Could someone help me with this problem? Example will be very useful.

PS:

  • ITestCOMClass - abstract interface,
  • TTestCOMClass- class, which implements this interface,
  • CoTTestCOMClass - factory class, which creates an instance of TTestCOMClass.

Thanks

Rene Pot
  • 24,681
  • 7
  • 68
  • 92
test_user
  • 21
  • 1
  • 2

1 Answers1

0

You're not using a fully qualified object name. It should be along the lines of ProgID.ObjectName:

$com = new COM('MyProject.ITestCOMClass');

Check out this question to get the list of COM objects on the system. That may reveal the full name you need to use.

Community
  • 1
  • 1
webbiedave
  • 48,414
  • 8
  • 88
  • 101
  • Thanks, it helps. But now I've got an error "Interface not supported" or "The required class is missing in ClassFactory". Maybe, you know, how to fix this? – test_user Apr 03 '12 at 20:26
  • 1
    I've found answer: PHP does not want work with COM objects, it requires Automation Objects (OLE). – test_user Apr 04 '12 at 20:54