I'm querying an MFC implemented COM object that is implemented as follows:
class CA :
public MfcComLib::IA
{
...
};
class CB :
public MfcComLib::IB
{
...
};
class ATL_NO_VTABLE CExposedCoClass :
public CComObjectRootEx<CComSingleThreadModel>,
public CA,
public CB
{
public:
BEGIN_COM_MAP(CExposedCoClass )
COM_INTERFACE_ENTRY(MfcComLib::IA)
COM_INTERFACE_ENTRY(MfcComLib::IB)
END_COM_MAP()
On the C# side I'm receiving an IUnknown ptr which comes through as an object. I've imported the TypeLib and have gotten the interface MfcComLibLib.IA but when I cast I get a failure because of the interface not being implemented.
Is there a way to query the IUnknown pointer to discover what interfaces are actually implemented on the object?