views:

139

answers:

2

..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

+1  A: 

You only need a proxy/stub dll if your interface needs to be marshalled. This means if your COM server is in process, and the interface is not passed between apartments, and you aren't going to be calling it from .Net or any other situation that would require it to be marshalled, then you do not need a proxy/stub dll.

1800 INFORMATION
+1  A: 

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.

Charlie