
October 4th, 2004, 02:55 AM
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 13
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by summer00 may i know what is [STAThread] for ? it will always be generated in Visual Studio.net when i create a C# console project but not in other IDE , wonder what is it used for. thanks
| That's just a guess -- I actually have no idea --, but I think it means "Single-Threaded Application Thread", which is an attribute that would allow the .NET framework to know that this entry-point leads to a single-threaded application and allows it to disable some overheaded linked to the multithreading support.
And rule number two: always look at the documentation before trying to explain something on a forum. On MSDN, I found that:
STAThreadAttribute Class (.NET Framework)
Indicates that the COM threading model for an application is single-threaded apartment (STA).
The link leads to the documentation of the attribute.
MrKoala
|