1
votes

When you have a COM client that exposes an Interface for an out of proc COM server to access, do you have to register the type library or .idl file with the system for the server to be able to access the interface?

I'm not sure if I can generate a proxy/stub DLL from this client process to register with the system.

Does it matter in what type of Apartment Threading the object implementing the interface is created or is this marshalling taken care of by the COM runtime?

I am not sure if my client is MTA or STA.

1
Why are you not sure about proxy/stub generation? It is the obvious approach. - Hans Passant
Yes, how do I generate the proxy/stub for the client.exe? - Tony The Lion
You generate proxy/stub for an out-proc server exactly the same way as you do it for an in-proc server. Ask MIDL to generate proxy/stub files, then compile and link them into a library. What's the problem here? - sharptooth
Can you tell me how I generate the proxy/Stub using MIDL? I have never needed to do it before. - Tony The Lion

1 Answers

2
votes

Your client and server are in separate processes, so you will need marshalling anyway - threading models won't affect this. You can use any kind of marshalling suitable - typelib (automation) marshalling, proxy/stub marshalling, whatever else - this is up to you.