API UpdateRegistryFromResource fails with error 0x8007007e

  • Thread starter Thread starter wn123456@gmail.com
  • Start date Start date
W

wn123456@gmail.com

Guest
I have a COM service created using the ATL wizard.
It works fine on few systems and on 1 system it fails to register.
System has,
OS Name Microsoft(R) Windows(R) Server 2003 Enterprise x64 Edition
Version 5.2.3790 Service Pack 1 Build 3790

(Same version other systems it is working fine)

The API, UpdateRegistryFromResource returns error 0x8007007e.

After manually copying the interface registry entries the service
registers fine and works fine.

Has anyone come across such issue ?

Code snippet of the register part is,
------------------
inline HRESULT CServiceModule::RegisterServer(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
UpdateRegistryFromResource(IDR_XYService, TRUE);

// Adjust the AppID for Local Server or Service
CRegKey keyAppID;
LONG lRes = keyAppID.Open(HKEY_CLASSES_ROOT, _T("AppID"),
KEY_WRITE);
if (lRes != ERROR_SUCCESS)
return lRes;

CRegKey key;
lRes = key.Open(keyAppID,
_T("{14437033-2F7E-45E1-91F1-683172AC3683}"), KEY_WRITE);
if (lRes != ERROR_SUCCESS)
return lRes;
key.DeleteValue(_T("LocalService"));

if (bService)
{
key.SetValue(_T("XY Service"), _T("LocalService"));
key.SetValue(_T("-Service"), _T("ServiceParameters"));

// Create service
Install();
SetDescription();
}

// Add object entries
hr = CComModule::RegisterServer(bRegTypeLib);

CoUninitialize();
return hr;
}
------------------
 
Back
Top