COM object method undefined COM object method undefined windows windows

COM object method undefined


Many things can go wrong with COM but I will try to help as best I can.I know that you use terms to describe the issue, like calling $com->SomeMethod(), but you need to be more specific in this case.

COM exposes its classes and functionality through two basic interfaces IUnknown and IDispatch.
It also has a DLL structure of C type, to expose functions (Not methods or classes) to the "out side" world.
Languages that can link directly to a DLL's, by reading the export table (like Delphi), make their calls directly on the interface exposed by the COM (Using IUnknown interface).

Script languages (like javascript, PHP python etc.) cannot call directly on the interface. Instead they use IDispatch interface.
This interface serve as a proxy that expose all COM functionality through simple text.
The IDispatch interface define standard methods for:
1. querying a COM on the interfaces it exposes
2. The methods' names of an object.
3. The parameters for each method.

In your post you display that IDispatch exposed three methods:
1. FuncName1
2. FuncName2
3. FuncName3

Therefore you cannot call SomeMethod on ISrvObject because it is not exposed via the IDispatch interface.
NOTE: COM uses WideString (UTF-16) text when exposing its interface. Take that into account once you do make a call on the interface methods.