469,644 Members | 1,982 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,644 developers. It's quick & easy.

STAThread attribute

What's the meaning of the STAThread attribute?
Thanks
Nov 16 '05 #1
1 8095
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.

Similar topics

11 posts views Thread by warren | last post: by
3 posts views Thread by Justine | last post: by
2 posts views Thread by Tom | last post: by
1 post views Thread by anadimpa | last post: by
1 post views Thread by Larry Lard | last post: by
12 posts views Thread by rafalK | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.