STA/MTA

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top