How does a COM client parses Type Library from a EXE COM server?

117 views Asked by At

Let's say we have a COM server EXE and COM client EXE running on the same machine.

COM server exposes IDispatch interface and carries a Type Library (.TLB file) into it's resource section.

COM client (something like PowerShell) wants to call a method and it does so via IDispatch::Invoke.

Before Client could make that call, If I understood it correctly, it must read Type Library of the COM class which can be done via the LoadTypeLib function

It's easy to digest if it were to be a COM server DLL, where client-server would be living in the same address space.

But what happens when the COM server is an EXE? Does the Client (which itself is an EXE) loads the server EXE (Not sure if that is even possible) ?

Remarks on MSDN has this

If the file is a DLL or an executable file, it is loaded. By default, the type library is extracted from the first resource of type ITypeLib.

0

There are 0 answers