joe_pool_is
Contributor
The standard Windows form starts with Main().
What is the benefit to starting my application this way:
as opposed to this way?
Also, I've looked up what a STAThread is (Single Threaded Apartment), but I don't really understand what it is or why I should be using this instead of something else. The help for it says it pertains to applications that use COM interop "if the thread actually makes a call to a COM component."
Huh? Could someone break it down for me?
What is the benefit to starting my application this way:
Code:
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
as opposed to this way?
Code:
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 form = new Form1();
form.ShowDialog();
}
Also, I've looked up what a STAThread is (Single Threaded Apartment), but I don't really understand what it is or why I should be using this instead of something else. The help for it says it pertains to applications that use COM interop "if the thread actually makes a call to a COM component."
Huh? Could someone break it down for me?