472,114 Members | 2,130 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,114 software developers and data experts.

STAThread attribute

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.