STA/MTA

  • Thread starter Thread starter mehdi
  • Start date Start date
M

mehdi

Hi folks,
I would like to know whether the ApartmentState (and specifically, the
Thread's SetApartmentState method) addresses the "COM Apartments".
i.e., does it only affect the threading model of those COM components
that's being referenced via an Interop Assembly within the .NET FX?

TIA,
Mehdi
 
Mehdi,

It doesn't affect the threading model of the components, but rather, the
thread that you are running on. It sets the apartment state of the thread
you are running on for COM interop, which COM will then use to decide how to
marshal calls between apartments if necessary.
 
Back
Top