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