comregfreecomout-of-process

How to use an out-of-process COM server without its tlb file


It is about Window COM component.

As we know, an exe can't be used as a registry-free COM component, to mimic such behavior, I start the Server.exe process myself by providing the exact path:

It works if I have the Server.tlb registred, but after unregister Server.tlb, it just failed to create the ppAppObject, even though I embed manifest into both Server.exe and Client.exe:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<file name="Server.tlb">
  <typelib tlbid="{DAC4A4C9-F84C-4F05-A7DC-E152869499F5}" version="1.0" helpdir=""></typelib>
</file>
<comInterfaceExternalProxyStub name="IApplication" iid="{D74208EA-71C2-471D-8681-9760B8ECE599}" tlbid="{DAC4A4C9-F84C-4F05-A7DC-E152869499F5}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
</assembly>

Do you have any idea on this?

Edit: It turns out that it really works if I specify tlbid for interfaces, and embed the manifest to both exe


Solution

  • Is the <comInterfaceExternalProxyStub> element sufficient? Don't you need the <comClass> and <typelib> elements as well?