DCOM on Windows 2003: error in COM-client
-
Hi, I’ve got a strange behaviour of DCOM on Windows 2003 Server. I’ve created COM-server (out-of-process) and COM-client for that COM-server. Both work successfully on local computer under any operation system. Also server and client work fine when COM-server is installed on Windows 2003 Server and when COM-client works on other PC running Windows XP. When I try run COM-server on Windows XP and COM-client on Windows 2003 Server, COM-client told me “Can’t query COM-server at remote PC: Permission denied”. Windows XP and Windows 2003 Server are located at the same network and at the same workgroup (not used domains). All permissions are set by default. What should I do? Here is the sample code of COM-client: CoInitializeEx(NULL,COINIT_MULTITHREADED); IReqAuth * pReqAuth; WCHAR *wszMachineName=L"ALPHA\0"; COSERVERINFO srv; ZeroMemory(&srv,sizeof(srv)); srv.pwszName=wszMachineName; MULTI_QI qi; qi.pIID=&IID_IReqAuth; qi.hr=0; qi.pItf=NULL; HRESULT hr=CoCreateInstanceEx(CLSID_ReqAuth, NULL, CLSCTX_SERVER, &srv, 1, &qi); if (SUCCEEDED(hr)) { pReqAuth=(IReqAuth *)qi.pItf; printf("COM object OK\n"); char szTmp[MAX_PATH]; BSTR AppVersion; hr=pReqAuth->GetVersion(&AppVersion); if (SUCCEEDED(hr)) { memset(szTmp,0,sizeof(szTmp)); wcstombs(szTmp,AppVersion,SysStringLen(AppVersion)); printf("AppVersion: %s\n",szTmp); SysFreeString(AppVersion); } else { sprintf(szTmp, "GetVersion failed hr = %x\n", hr); printf(szTmp); }; pReqAuth->Release(); } else { printf("Error creating COM-object %d\n",GetLastError()); }; ::CoUninitialize(); Sleep(200); Please help, my brains can’t think anymore. Sincerely Yours, RadioShark
-
Hi, I’ve got a strange behaviour of DCOM on Windows 2003 Server. I’ve created COM-server (out-of-process) and COM-client for that COM-server. Both work successfully on local computer under any operation system. Also server and client work fine when COM-server is installed on Windows 2003 Server and when COM-client works on other PC running Windows XP. When I try run COM-server on Windows XP and COM-client on Windows 2003 Server, COM-client told me “Can’t query COM-server at remote PC: Permission denied”. Windows XP and Windows 2003 Server are located at the same network and at the same workgroup (not used domains). All permissions are set by default. What should I do? Here is the sample code of COM-client: CoInitializeEx(NULL,COINIT_MULTITHREADED); IReqAuth * pReqAuth; WCHAR *wszMachineName=L"ALPHA\0"; COSERVERINFO srv; ZeroMemory(&srv,sizeof(srv)); srv.pwszName=wszMachineName; MULTI_QI qi; qi.pIID=&IID_IReqAuth; qi.hr=0; qi.pItf=NULL; HRESULT hr=CoCreateInstanceEx(CLSID_ReqAuth, NULL, CLSCTX_SERVER, &srv, 1, &qi); if (SUCCEEDED(hr)) { pReqAuth=(IReqAuth *)qi.pItf; printf("COM object OK\n"); char szTmp[MAX_PATH]; BSTR AppVersion; hr=pReqAuth->GetVersion(&AppVersion); if (SUCCEEDED(hr)) { memset(szTmp,0,sizeof(szTmp)); wcstombs(szTmp,AppVersion,SysStringLen(AppVersion)); printf("AppVersion: %s\n",szTmp); SysFreeString(AppVersion); } else { sprintf(szTmp, "GetVersion failed hr = %x\n", hr); printf(szTmp); }; pReqAuth->Release(); } else { printf("Error creating COM-object %d\n",GetLastError()); }; ::CoUninitialize(); Sleep(200); Please help, my brains can’t think anymore. Sincerely Yours, RadioShark