c++winapicommarshallingidispatch

Does a "pure" IDispatch interface require a proxy/stub DLL?


..for an out-of-process-server, or can I call a dispatch interface without registering a proxy/stub?

The interface in question is very high level, so performance is a non-issue, and I could make the whole thing registration-free, which is a big plus


Solution

  • I'm pretty sure you don't need to provide a custom proxy/stub dll if you limit your interface(s) to automation-compatible types. In that case, the system can use the automation marshaler and doesn't need any additional help. I believe the automation-compatible types are the types that can fit into a VARIANT, e.g. simple POD types, BSTRs, and the like.

    I found this KB article which has some discussion of the automation marshaler, although it's not specifically targeted at your question. It does list the compatible types, at the very least. It also mentions that you need to specifically identify the automation marshaler in the registration for your component, but in my experience this isn't necessary - your mileage may vary.

    Lastly, you may need to implement IProvideClassInfo as well; I usually use the implementation provided by ATL.