Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

“Empty” inherited COM interface is not marshalled properly

13 views
Skip to first unread message

igor.r...@gmail.com

unread,
Oct 28, 2012, 6:47:25 AM10/28/12
to
I've got an in-proc COM server (dll, built in MSVC10), which is used in a C# client. One of the interfaces is defined like this:
[
object,
uuid(some guid),
dual,
nonextensible,
helpstring("IDerived Interface"),
pointer_default(unique)
]
interface IDerived : IBase{
};

The co-class implements both IDerived and IBase (and some other interfaces):
[
uuid(some guid),
helpstring("SomeClass Class"),
noncreatable,
hidden
]
coclass SomeClass
{
[default] interface IDerived;
interface IBase;
// etc.
};

The co-class is apartment-threaded. When an MTA client thread acquires IDerived and tries to call any of its methods (inherited from IBase), it crashes somewhere in proxy/stub. In STA it works well, so I believe IDerived is not marshalled correctly. On the other hand, if I QI IBase explicitly or if I add a method to IDerived, everything works well.

Why isn't IDerived marshalled correctly?
0 new messages