///<summary>
/// The main entry point for the application.
///</summary>
[STAThread]
staticvoid Main()
{
//AddGlobalHandlers();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new MainForm());
Application.ThreadException += newThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += newUnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.Run(newMainForm());
}
staticvoid CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
MessageBox.Show(“CurrentDomain_UnhandledException: “ + e.ExceptionObject.ToString());
}
staticvoid Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
MessageBox.Show(“Application_ThreadException: “ + e.Exception.Message);
}