By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,203 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,203 IT Pros & Developers. It's quick & easy.

STAThread attribute

P: n/a
What's the meaning of the STAThread attribute?
Thanks
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Alberto,

The STAThread attribute basically tells the runtime to set the apartment
model for thread that the application is first run on. It allows the
threading model to be set before any initialization code is called (which
might happen before your code is reached by the runtime).

It's needed for some of the windows controls, as they are wrappers to
COM components which require the COM environment to be set up properly.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Alberto" <al*****@nospam.com> wrote in message
news:O8**************@TK2MSFTNGP10.phx.gbl...
What's the meaning of the STAThread attribute?
Thanks

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.