CoMarshalInterThreadInterfaceInStream problems
Hi all:
I have a com class implements two com interfaces:
[
object,
uuid("827E9256-AEF5-4338-9B4B-8109DC7F6050"),
helpstring("IBasePlayer Interface"),
pointer_default(unique)
]
__interface IBasePlayer : IUnknown {
...
}
[
object,
uuid("63E39D66-862C-475d-B0ED-C6BB8B31618F"),
helpstring("IBasePlayer2 Interface"),
pointer_default(unique)
]
__interface IBasePlayer2 : IUnknown{
...
}
class ATL_NO_VTABLE CoStreamPlayer :
public IBasePlayer, public IBasePlayer2{
...
BEGIN_COM_MAP(CoStreamPlayer)
COM_INTERFACE_ENTRY(IBasePlayer)
COM_INTERFACE_ENTRY(IBasePlayer2)
END_COM_MAP()
...
}
//my marshal code:
HRESULT hr = S_OK;
IStream *pStream = NULL;
CComPtr<IBasePlayer> pbp;
pbp.CoCreateInstance(CLSID_CoStreamPlayer);
hr = CoMarshalInterThreadInterfaceInStream(IID_IBasePlayer, pbp,
&pStream); // ok
CQIComPtr<IBasePlayer2> pbp2 = pbp; // ok
hr = CoMarshalInterThreadInterfaceInStream(IID_IBasePlayer2, pbp2,
&pStream); // return E_NOINTERFACE
why call CoMarshalInterThreadInterfaceInStream with IBasePlayer2 return
E_NOINTERFACE? Can anybody help me ? Thanks very much.
bourne
2006-10-09