Microsoft KB Archive/260133

= PRB: Apartment Threaded Visual Basic Component Displays As a Single Thread Apartment in COM+ =

Article ID: 260133

Article Last Modified on 7/31/2001

-

APPLIES TO


 * Microsoft COM+ 1.0

-



This article was previously published under Q260133



SYMPTOMS
When a Visual Basic ActiveX DLL that has its threading model set to Apartment Threaded (in its project properties in Visual Basic) is imported into a COM+ application, the threading model attribute for its classes displays as a Single Threaded Apartment in the Component Services Microsoft Management Console (MMC) administration tool.



STATUS
This behavior is by design.



Steps to Reproduce the Behavior

 * 1) Create a new Visual Basic ActiveX DLL.
 * 2) Click Properties to view the properties of the project in Visual Basic in the Project menu. Verify that in Threading Model, &quot;Apartment Threaded&quot; is selected.
 * 3) Compile the DLL, and then put it into a new COM+ application.
 * 4) Click Properties to view the properties of the component in the newly created COM+ application in the Component Services MMC snap-in.
 * 5) In the Concurrency tab, Single Thread Apartment is shown as the Threading Model.
 * 6) Change the &quot;Threading Model&quot; for the Visual Basic project to &quot;Single Threaded&quot; in the Project Properties General tab.
 * 7) Recompile the project.
 * 8) Replace the DLL in the COM+ application you created with the new DLL.
 * 9) Verify that the threading model has changed to Main Thread Apartment.

The confusion stems from different names for the same threading model. The components marked as Single Threaded in Visual Basic are created in the main &quot;Single-threaded Apartment&quot; (STA) (as are legacy components whose threading model is not specified). COM+ calls these components Main Thread Apartment components. The Single Thread Apartment threading model in the COM+ catalog is the same as the Apartment Threaded threading model in Visual Basic.

