Microsoft KB Archive/312866

= Cannot Create Instance of Remote COM+ Component from Windows NT 4.0 by Using CoGetClassObject or CreateInstance =

Article ID: 312866

Article Last Modified on 6/5/2003

-

APPLIES TO

 Microsoft COM+ 1.0, when used with:  Microsoft Windows 2000 Standard Edition

 Microsoft Windows NT 4.0 

-



This article was previously published under Q312866



SYMPTOMS
You cannot create an instance of a remote COM+ component under the following circumstances:
 * You install COM+ Hotfix Rollup Package 15, 16, or 17 on a computer that is running Windows 2000. -and-


 * You export and install a COM+ application proxy on a client computer that is running Microsoft Windows NT 4.0. -and-


 * You use the CreateObject function in a Microsoft Visual Basic Scripting Edition (VBScript) application to create an instance of the remote component. -or-


 * You use the IClassFactory::CreateInstance method and the CoGetClassObject function in a Microsoft Visual C++ application to create an instance of the remote component.

The Dllhost.exe application is started on the server, but no instance of the component is created. Furthermore, the IClassFactory::CreateInstance method returns error 0x80040154 (REGDB_E_CLASSNOTREG).

NOTE: This problem does not occur when you export and install a COM+ application proxy on a client computer that is running Windows 2000 or when you use the CreateObject function in a Microsoft Visual Basic application.



CAUSE
This problem occurs because Windows NT 4.0 cannot fill the original class context in activation properties objects. As a result, the original class context is not passed correctly to the server. This problem is a regression that is caused by fixing the bug that is described in the following Microsoft Knowledge Base article:

303850 FIX: CoGetClassObject May Not Activate Remote COM+ Component



RESOLUTION
To resolve this problem, obtain Microsoft COM+ Hotfix Rollup 18.1. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

313582 INFO: Availability of Windows 2000 Post-Service Pack 2 COM+ Hotfix Rollup Package 18.1

To resolve this problem, obtain the latest service pack for Windows 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

260910 How to Obtain the Latest Windows 2000 Service Pack

<div class="workaround_section">

WORKAROUND
To work around this problem in a Visual C++ client application, use the CoCreateInstance function instead of the CoGetClassObject and the CreateInstance functions.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Windows 2000 Service Pack 3.

<div class="moreinformation_section">

Steps to Reproduce the Behavior

 * 1) Create a new COM+ application on a computer that is running Windows 2000 and that has COM+ Hotfix Rollup Package 15, 16, or 17.
 * 2) Create a simple Active Template Library (ATL) component.
 * 3) Export the application as COM+ proxy.
 * 4) Run the Microsoft Windows Installer on a client computer that is running Windows NT 4.0.
 * 5) Run a simple VBScript application that calls the CreateObject function (&quot;component progid&quot;). Notice that you receive error 800A01AD.

Alternatively, run a simple Visual C++ application that calls CoGetClassObject and IClassFactory::CreateInstance. Notice that CreateInstance returns the REGDB_E_CLASSNOTREG error.

NOTE: You can successfully run a Microsoft Visual Basic application that calls CreateObject because Visual Basic uses CoCreateInstance.

For additional information about how to obtain a hotfix for Windows 2000 Datacenter Server, click the article number below to view the article in the Microsoft Knowledge Base:

265173 The Datacenter Program and Windows 2000 Datacenter Server Product

For additional information about how to install multiple hotfixes with only one reboot, click the article number below to view the article in the Microsoft Knowledge Base:

296861 Use QChain.exe to Install Multiple Hotfixes with One Reboot

Additional query words: kbIISCom kbWin2000preSP3COMRollup18Fix instantiate instanciate

Keywords: kbbug kbfile kbfix kbwin2000presp3fix kbwin2000sp3fix KB312866

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.