Solved

Server Register Problem

Posted on 1998-10-15
1
752 Views
Last Modified: 2012-06-27
In my DCOM server, during server's registration, I call
function: UpdateRegistryFromResource(IDR_ORVserver, 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::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
      hr = UpdateRegistryFromResource(IDR_ORVserver, 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-8F39-006097CA2FEA}"));
      if (lRes != ERROR_SUCCESS)
            return lRes;
      key.DeleteValue(_T("LocalService"));
      
      if (bService)
      {
            key.SetValue(_T("ORVserver"), _T("LocalService"));
            key.SetValue(_T("-Service"), _T("ServiceParameters"));
            // Create service
            Install();
      }

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

      CoUninitialize();

      return hr;
}
0
Comment
Question by:zemanek
1 Comment
 

Accepted Solution

by:
tsollas earned 200 total points
ID: 1175235
This will sound silly, but UpdateRegistryFromResourceID() uses the ATL registrar which is a COM interface implemented in ATL.DLL.  The error you're getting indicates that that interface is probably not registered.  So, you'll want to check if ATL.DLL is installed and registered on the 95 machines that it failed on.  You should also check to make sure those 95 machines have DCOM95 installed as well.

You can do that, or statically link to the registrar code. Define DECLARE_REGISTRY_RESOURCEID in your object's declaration, and at the top of stdafx.h, add #define _ATL_STATIC_REGISTRY (this is from the VC/ATL docs).
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now