Since I have no energy to type a long post today (sigh), I'll spare you the gory details on the cause of this error. Here are the main reasons why you would be seeing this error -
class ManagedEngine : public ICorDebugManagedCallback, public ICorDebugManagedCallback2
{
}
HRESULT __stdcall ManagedEngine::QueryInterface(const IID & iid, void** ppv)
if (iid == IID_IUnknown)
* ppv = static_cast<ICorDebugManagedCallback*>(this); // original implementation
else if (iid == IID_ICorDebugManagedCallback)
* ppv = static_cast<ICorDebugManagedCallback*>(this);
else if (iid == IID_ICorDebugManagedCallback2)
* ppv = static_cast<ICorDebugManagedCallback2*>(this);
else
* ppv = NULL;
return E_NOINTERFACE;
reinterpret_cast<IUnknown*>(*ppv)->AddRef();
return S_OK;