I know that VC ++ 6.0 is a very old language, but I have no choice, I just support an existing program, and I encounter this error
Unhandled exception in Assess.exe (KERNELBASE.DLL): 0xE06D7363: Microsoft C++ Exception
And here is my code
HRESULT hr = CoInitialize(NULL);
IModulePtr pI(__uuidof(RPTAModuleInterface));
After debugging and using, the f11program switches to COMIP.Hand here is the code
explicit _com_ptr_t(const CLSID& clsid, IUnknown* pOuter = NULL, DWORD dwClsContext = CLSCTX_ALL) throw(_com_error)
: m_pInterface(NULL)
{
HRESULT hr = CreateInstance(clsid, pOuter, dwClsContext);
if (FAILED(hr) && (hr != E_NOINTERFACE)) {
_com_issue_error(hr);
}
}
And so CreateInstance
HRESULT CreateInstance(const CLSID& rclsid, IUnknown* pOuter = NULL, DWORD dwClsContext = CLSCTX_ALL) throw()
{
HRESULT hr;
_Release();
if (dwClsContext & (CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)) {
IUnknown* pIUnknown;
hr = CoCreateInstance(rclsid, pOuter, dwClsContext, __uuidof(IUnknown), reinterpret_cast<void**>(&pIUnknown));
if (FAILED(hr)) {
return hr;
}
hr = OleRun(pIUnknown);
if (SUCCEEDED(hr)) {
hr = pIUnknown->QueryInterface(GetIID(), reinterpret_cast<void**>(&m_pInterface));
}
pIUnknown->Release();
}
else {
hr = CoCreateInstance(rclsid, pOuter, dwClsContext, GetIID(), reinterpret_cast<void**>(&m_pInterface));
}
return hr;
}
I do not know what kind of error this is, this is the header file, and I think there is no error. Any idea how to fix this thing?
Update
RPTAInterface.tlhI saw an ad in mineRPTAModuleInterface
struct /* coclass */ RPTAModuleInterface;
struct __declspec(uuid("d6134a6a-a08e-36ab-a4c0-c03c35aad201"))
RPTAModuleInterface;