zemanek
asked on
Server Register Problem
In my DCOM server, during server's registration, I call
function: UpdateRegistryFromResource (IDR_ORVse rver, TRUE).
There is no problem on my machine with Windows NT Workstation, but when I try register server on other machine
with Windows 95, function UpdateRegistryFromResource failed.
Return value is 2147746132. I try it also on other machines
with Windows 95 and result is: 1 success and 2 failed.
Where is the problem?
source code:
inline HRESULT CServiceModule::RegisterSe rver(BOOL bRegTypeLib, BOOL bService)
{
HRESULT hr = CoInitialize(NULL);
if (FAILED(hr))
return hr;
// Remove any previous service since it may point to
// the incorrect file
Uninstall();
// Add service entries
hr = UpdateRegistryFromResource (IDR_ORVse rver, TRUE);
if (FAILED(hr))
return hr;
// Adjust the AppID for Local Server or Service
CRegKey keyAppID;
LONG lRes = keyAppID.Open(HKEY_CLASSES _ROOT, _T("AppID"));
if (lRes != ERROR_SUCCESS)
return lRes;
CRegKey key;
lRes = key.Open(keyAppID, _T("{A8E3E5D4-F6BA-11D1-8F 39-006097C A2FEA}"));
if (lRes != ERROR_SUCCESS)
return lRes;
key.DeleteValue(_T("LocalS ervice"));
if (bService)
{
key.SetValue(_T("ORVserver "), _T("LocalService"));
key.SetValue(_T("-Service" ), _T("ServiceParameters"));
// Create service
Install();
}
// Add object entries
hr = CComModule::RegisterServer (bRegTypeL ib);
CoUninitialize();
return hr;
}
function: UpdateRegistryFromResource
There is no problem on my machine with Windows NT Workstation, but when I try register server on other machine
with Windows 95, function UpdateRegistryFromResource
Return value is 2147746132. I try it also on other machines
with Windows 95 and result is: 1 success and 2 failed.
Where is the problem?
source code:
inline HRESULT CServiceModule::RegisterSe
{
HRESULT hr = CoInitialize(NULL);
if (FAILED(hr))
return hr;
// Remove any previous service since it may point to
// the incorrect file
Uninstall();
// Add service entries
hr = UpdateRegistryFromResource
if (FAILED(hr))
return hr;
// Adjust the AppID for Local Server or Service
CRegKey keyAppID;
LONG lRes = keyAppID.Open(HKEY_CLASSES
if (lRes != ERROR_SUCCESS)
return lRes;
CRegKey key;
lRes = key.Open(keyAppID, _T("{A8E3E5D4-F6BA-11D1-8F
if (lRes != ERROR_SUCCESS)
return lRes;
key.DeleteValue(_T("LocalS
if (bService)
{
key.SetValue(_T("ORVserver
key.SetValue(_T("-Service"
// Create service
Install();
}
// Add object entries
hr = CComModule::RegisterServer
CoUninitialize();
return hr;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.