I have the following setup. There\'s a COM server that is installed into COM+ (to run in a separate process) and has this interface definition:
[object, uuid(\"I
One of the possible scenarios that matches the behavior is the following:
IStream
, does not have a corresponding COM_INTERFACE_ENTRY
map entry and does not make the interface available, the caller might have obtained the pointer via non-COM way, e.g. direct C++ castThis is easy to check by QueryInterface
'ing the stream on the caller side before the call.
The callee in this scenario can just reinterpret_cast
to IStream
and have it nicely working.
you may replace IUnknown by IDispatch as parameter type of your method. In my mind, the server actually has a stub instead of the stream itself since it is in another process.
this is just a guess
I hope this helps
You can either have your IDL import objidl.idl, or define IStream (and ancestors) manually in your own IDL (just be sure to use the standard IID value for it). Then you can use IStream instead of IUnknown as your parameter type and not worry about QueryInterface()
anymore.