Problems using dcomcnfg to configure ActiveX library objects (DLLs).

By: Christopher Moeller

Abstract: Client application fails to make a remote DCOM connection. OLEException: Class not registered

Issues relating to configuring DCOM for ActiveX Library objects.

Description of problem:
After successfully building and registering the server object DLL (e.g. ActiveX Library with Automation object),  the Client application produces a 'Class not found' error message when attempting a remote DCOM connection using CreateRemote().  Server applications created as executables (e.g. Application with Automation object) do not appear to have this problem.

The crux of this issue is that, in order to make DCOM work, the COM object must be properly configured using an external utility.  Unfortunately, the default utility for configuring DCOM (dcomcnfg.exe) does not seem to reliably locate COM library objects (DLLs), but is only able to find COM executable object (EXE).  Furthermore, even when it does display the library, there seems to be no way from within the utility to configure the object to make it work.  The reason for this is because the dcomcnfg utility does not allow specification of a surrogate process to host the DLL object for the Inproc Server.

The workaround is to download and install OLEview (free):

Now, the critical step is specifying that the implementation utilize a surrogate process for hosting the DLL.  This may be done in the following way:

  1.  Register the DLL using regsvr32
  2.  Run OLEview.
  3.  In the left panel, expand 'All Objects,' and select your server object.
  4.  In the right panel, select the 'Implementation' tab.
  5.  Then select the sub-tab 'Inproc Server'
  6.  Check 'Use Surrogate Process'

This may need to be done on each computer that will be hosting the server.  You will also need to register the DLL on each system before you can use the Client application.  Finally, if you receive errors regarding access rights, you may need to specify 'Launch Permissions' and 'Access Permissions' in OLEview.

Borland Developer Support

Server Response from: ETNASC01