📄 0,1410,26048,00.html
字号:
<HTML>
<HEAD>
<TITLE>Problems using dcomcnfg to configure ActiveX library objects (DLLs).</TITLE>
</HEAD>
<BODY>
<table>
<TR>
<td>
<SPAN CLASS="title3"><b>Problems using dcomcnfg to configure ActiveX library objects (DLLs).</b></SPAN>
<P>
<BLOCKQUOTE CLASS="abstract"><B>Abstract:</B>Client application fails to make a remote DCOM connection. OLEException: Class not registered</BLOCKQUOTE><P>
</table>
Issues relating to configuring DCOM for ActiveX
Library objects.
<p>Description of problem:
<br>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.
<p>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
<i>reliably</i> 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.
<p>The workaround is to download and install OLEview (free):
<p> http://www.microsoft.com/com/resources/oleview.asp
<p>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:
<p> 1. Register the DLL using regsvr32
<br> 2. Run OLEview.
<br> 3. In the left panel, expand 'All Objects,' and select
your server object.
<br> 4. In the right panel, select the 'Implementation' tab.
<br> 5. Then select the sub-tab 'Inproc Server'
<br> 6. Check 'Use Surrogate Process'
<p>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.
</body>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -