WhenI start a new windows app, this code is automatically put in near the bottom of the code. What is it? I've taken out the line and the app still runs, just wondering why the designer puts it there.
Printable View
WhenI start a new windows app, this code is automatically put in near the bottom of the code. What is it? I've taken out the line and the app still runs, just wondering why the designer puts it there.
[STAThread]
Single Threaded Apartement Thread
What is it (what is it used for) / do i need it? :D
it is for COM interoperability.
if u have some experience writing COM objects, u probably recall COM Threading Model (aka COM Apartment Model).
basically, if u need the Win Form to run also in unmanage code (eg COM client) leave that attribute as it is, if not, u can remove it.