Volleynerd Knowledge Base

Thursday, October 23, 2003


STA COM exe server receives inbound calls on random thread

At work today, Tim's COM exe server was recieving inbound calls from client calls on random RPC threads, even though his EXE was calling CoInitialize(0) in WinMain, therefore putting the object into the STA.

Turns out, the object was originally created with the Add New Class wizard, and the box was checked for "Free Threaded Marshaller".

What this does apparently is the proxy/stub code sends the client request into the EXE on one of it's COM/RPC provided threads.

The Free Threaded Marshaller is created in an ATL object's implementation of FinalConstruct. There you will see the call to CoCreateFreeThreadedMarshaler



Comments: Post a Comment

Home