Error - hr = 0x80040110 Class does not support aggregation (or class object is remote)
-
Hi , I am creating a Unit Test script in CPPUnit for a new component. I am calling CoCreateInstance ()for a component to be created , but i am getting the error in subject line. Please provide the comments so that i can resolve the issue.
Since the COM component does not support aggregation, pass a
NULL
as the second parameter toCoCreateInstance
.«_Superman_»
-
Since the COM component does not support aggregation, pass a
NULL
as the second parameter toCoCreateInstance
.«_Superman_»
Actually my component support aggregation , i am making unit test script using CPPUnit framwork. HRESULT hr = CLSIDFromString( _T("{3E31EB53-8CEF-4FC9-94AC-8619887851D3}"), &clsidTemp ); hr = CoCreateInstance(clsidTemp, GetControllingUnknown() , CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&m_pMessageRouter); here i am getting error in subject line in hr.. Please provide comments.
-
Hi , I am creating a Unit Test script in CPPUnit for a new component. I am calling CoCreateInstance ()for a component to be created , but i am getting the error in subject line. Please provide the comments so that i can resolve the issue.
//sClassName eg:ResoftSign.ResoftSignCtrl //ResoftSign is the lib name //ResoftSignCtrl is the class name IDispatch* CreateClassComDispatch(BSTR sClassName) { CLSID clsid; IUnknown *pUnk; IDispatch *pDisp; HRESULT hr; CLSIDFromProgID(sClassName, &clsid); hr = CoInitialize(NULL); //see here. if(FAILED(hr)) return FALSE; hr = CoCreateInstance(clsid,NULL,CLSCTX_ALL,IID_IUnknown,(void**)&pUnk); if(FAILED(hr)) return FALSE; hr = pUnk->QueryInterface(IID_IDispatch, (void **)&pDisp); if(FAILED(hr)) { pUnk->Release(); return FALSE; } return pDisp; }