ATL CLSCTX_LOCAL_SERVER get E_NOINTERFACE error...
-
Using ATL/Windows 2000 I have created an .EXE ATL (simple object) COM object named EXEServer, I then created a (client) MFC .exe to try and create the .EXE ATL COM server object on the same machine using CoCreateInstance(....,CLSCTX_LOCAL_SERVER....), shown below - no luck !!!! I get the HRESULT return error E_NOINTERFACE when I do a simple CoCreateInstance on the ATL .EXE COM object via the client. What is going wrong ? How can I fix this...? I've checked both the registry AND OleViewer and the ATL COM ServerEXE IS there and seems to be active....what am I missing.....? please help me I am going crazy... // The client MFC code... BOOL CClientEXEDlg::OnInitDialog() { .... CoInitialize(NULL); IExeServer* pIHelloWorld = NULL; HRESULT hr = CoCreateInstance (CLSID_ExeServer, NULL, CLSCTX_LOCAL_SERVER, CLSCTX_, IID_IExeServer, reinterpret_cast(&pIHelloWorld)); BSTR bstrMsg = NULL; void *pMsgBuf; ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT ), (LPSTR)&pMsgBuf, 0, NULL ); AfxMessageBox((LPSTR)pMsgBuf); if (hr == E_NOINTERFACE) { AfxMessageBox("CLASS_E_NOINTERFACE"); // this error is always // there } if (FAILED(hr)) { AfxMessageBox("FAILED"); CoUninitialize(); EndDialog(TRUE); return TRUE; } else { m_edit = bstrMsg; ::SysAllocString(bstrMsg); } hr = pIHelloWorld->SayHello(&bstrMsg); pIHelloWorld->Release(); UpdateData(FALSE); // TODO: Add extra initialization here CoUninitialize(); return TRUE; }:(( john s.
-
Using ATL/Windows 2000 I have created an .EXE ATL (simple object) COM object named EXEServer, I then created a (client) MFC .exe to try and create the .EXE ATL COM server object on the same machine using CoCreateInstance(....,CLSCTX_LOCAL_SERVER....), shown below - no luck !!!! I get the HRESULT return error E_NOINTERFACE when I do a simple CoCreateInstance on the ATL .EXE COM object via the client. What is going wrong ? How can I fix this...? I've checked both the registry AND OleViewer and the ATL COM ServerEXE IS there and seems to be active....what am I missing.....? please help me I am going crazy... // The client MFC code... BOOL CClientEXEDlg::OnInitDialog() { .... CoInitialize(NULL); IExeServer* pIHelloWorld = NULL; HRESULT hr = CoCreateInstance (CLSID_ExeServer, NULL, CLSCTX_LOCAL_SERVER, CLSCTX_, IID_IExeServer, reinterpret_cast(&pIHelloWorld)); BSTR bstrMsg = NULL; void *pMsgBuf; ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT ), (LPSTR)&pMsgBuf, 0, NULL ); AfxMessageBox((LPSTR)pMsgBuf); if (hr == E_NOINTERFACE) { AfxMessageBox("CLASS_E_NOINTERFACE"); // this error is always // there } if (FAILED(hr)) { AfxMessageBox("FAILED"); CoUninitialize(); EndDialog(TRUE); return TRUE; } else { m_edit = bstrMsg; ::SysAllocString(bstrMsg); } hr = pIHelloWorld->SayHello(&bstrMsg); pIHelloWorld->Release(); UpdateData(FALSE); // TODO: Add extra initialization here CoUninitialize(); return TRUE; }:(( john s.