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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
I've found answer: PHP does not want work with COM objects, it requires Automation Objects (OLE).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.