Hello!
I am working on MFC dialogue based application,for that I used Dll functionality in COM. DLL is build successfully. I register it with registry editor by using GUID for the interfaces in dll application.I wrote below code for Initialise com object,but it gives error that "Class Not Registered.I also copy the code of my .reg file.
//////////////Dialogue based application code////////////////////
ISum *pISum=NULL;
<pre lang="cs">HRESULT hr=CoInitialize(NULL);
if(FAILED(hr))
{
AfxMessageBox(L"Com Library cannot initialized",MB_ICONERROR);
return FALSE;
}
hr=CoCreateInstance(CLSID_SumSubtract,NULL,CLSCTX_INPROC_SERVER,IID_ISum,(void **)&pISum);
if(FAILED(hr))
{
AfxMessageBox(L"ISeum Interface cannot be obtained",MB_ICONERROR);
return FALSE;
}</pre>
////////.Reg file code////////////////
REGEDIT4
[HKEY_CLASSES_ROOT\CLSID\{996BA870-10DF-44f3-81C1-3C9332ADFE35}]
@="ClassFactoryMFC"
[HKEY_CLASSES_ROOT\CLSID\{996BA870-10DF-44f3-81C1-3C9332ADFE35}\InProcServer32]
@=C:\\Windows\\System32\\ClassFactoryMFC.dll"
Please give me solution!!!