C
Chukkalove
While trying to run an ApplicationContext rather than creating a new form, I
noticed that the application never quits.
I stripped the code out of it down to the bone and it still doesnt exit.
I put a break in the OnApplicationExit function, it's never reached
Any idea what i'm missing?
public class MyApplication : ApplicationContext
{
public MyApplication()
{
Application.ApplicationExit += new EventHandler(this.OnApplicationExit);
foobar();
foobar();
ExitThread();
}
private void OnApplicationExit(object o, System.EventArgs e)
{
DoSomething();
}
[STAThread]
static void Main()
{
Application.Run(new MyApplication());
}// function
noticed that the application never quits.
I stripped the code out of it down to the bone and it still doesnt exit.
I put a break in the OnApplicationExit function, it's never reached
Any idea what i'm missing?
public class MyApplication : ApplicationContext
{
public MyApplication()
{
Application.ApplicationExit += new EventHandler(this.OnApplicationExit);
foobar();
foobar();
ExitThread();
}
private void OnApplicationExit(object o, System.EventArgs e)
{
DoSomething();
}
[STAThread]
static void Main()
{
Application.Run(new MyApplication());
}// function