FIX: CoGetClassObject May Not Activate Remote COM+ Component (303850)



The information in this article applies to:

  • Microsoft COM+ 1.0, when used with:
    • the operating system: Microsoft Windows 2000 SP1
    • the operating system: Microsoft Windows 2000 SP2

This article was previously published under Q303850

SYMPTOMS

When you use a COM+ server application and a remote client, if a COM+ proxy is installed on client computer or if you call the CoCreateInstanceEx method in a client application, the activation occurs on a remote COM+ server. However, if you call the CoGetClassObject and CreateInstance functions, and the only server type library is registered on the client computer through Regsvr32.exe, the activation occurs locally on the client computer, regardless if you set the remote host name or the content of COSERVERINFO.

For example, you may encounter these symptoms when the client uses Visual Basic Scripting Edition (VBScript) with CreateObject("progID", remoteServerName), which internally uses CoGetClassObject and CreateInstance.

If the VBScript client must dynamically decide which COM+ server to use based on incoming traffic, only the server type library is registered on the client computer, and the activation does not occur on the COM+ server. If a COM+ proxy is registered on the client, the VBScript client loses the flexibility to choose the COM+ server.

CAUSE

The original class context is lost between the class factory wrapper on COM+ and the caller of CoGetClassObject. This bug does not affect the Microsoft Transaction Server (MTS) server or client or the legacy Distributed Component Object Model (DCOM) server or client.

RESOLUTION

To resolve this problem, obtain Microsoft COM+ Rollup Hotfix 15. For additional information, please see the following article in the Microsoft Knowledge Base:

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

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


WORKAROUND

Use one of the following methods to work around this problem:
  • Export the proxy, and register the proxy on the client computer.
  • Use CoCreateInstanceEx to replace CoGetClassObject and CreateInstance. For example:
    hr = CoCreateInstanceEx(__uuidof (CTest),NULL,
        CLSCTX_REMOTE_SERVER, &cif, 1, &mq);
    pUnk= mq.pItf;
    					

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.

MORE INFORMATION

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

For additional information about how to install Windows 2000 and Windows 2000 hotfixes at the same time, click the article number below to view the article in the Microsoft Knowledge Base:

249149 Installing Microsoft Windows 2000 and Windows 2000 Hotfixes


Modification Type:MajorLast Reviewed:6/5/2003
Keywords:kbbug kbfix kbWin2000PreSP3Fix kbWin2000sp3fix KB303850