Hi,
System.Threading.ApartmentState has 3 possible values: MTA, STA, and
Unknown.
It seems to me that MTA is a superset of STA, and MTA should be fine for
CLR calling COM or COM calling a CLR. But then why is STA needed in the
.net world?

The C# Console & EXE wizards generate [STAThread] by default. Why dont
they generate [MTAThread] by default?

Is the answer that MTA calling STA is not compatible and, since 
most COM objects are STA, having [MTAThread] would cause COM to create a
MTA compartment as a proxy to marshal calls to the COM STA?

The C# service wizard does not generate any apartment state default
code. Why should it be different in this respect to a regular EXE?

Regards,
Jonni 

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to