FIX: New STA Object Cannot Join Caller's STA If the Caller Is Not Configured

Article translations Article translations
Article ID: 298127 - View products that this article applies to.
This article was previously published under Q298127
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page

SYMPTOMS

If a COM+ component (Component1) is marked as single-threaded apartment (STA), when Component1 is instantiated by an STA thread that is not from the COM+ STA thread pool, Component1 is not created in the caller's thread. In other words, Component1 is bound with one of the threads from the COM+ STA thread pool.

CAUSE

When the object from Component1 is instantiated from an STA, the apartment of the caller's thread is only checked if it is in the COM+ STA thread pool. If possible, create all COM+ objects that live on STA threads in the caller's thread. This bug violates this COM+ rule.

RESOLUTION

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
This fix is included with the fixes that are described in the following Microsoft Knowledge Base article:
299407 INFO: Post Windows 2000 Service Pack 2 COM+ Rollup Hotfix 13 Is Available

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

Steps to Reproduce Behavior

  1. Call the CoInitialize function on your main thread into the STA.
  2. Call the CoCreate function on a configured STA component. Note that CoCreate does not run on the thread that you created.

Properties

Article ID: 298127 - Last Review: October 23, 2013 - Revision: 2.1
APPLIES TO
  • Microsoft COM+ 1.0, when used with:
    • Microsoft Windows 2000 Service Pack 2
Keywords: 
kbnosurvey kbarchive kbbug kbfix kbwin2000presp3fix kbwin2000sp3fix KB298127

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com