ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/AnywhereTS-MSSQL/trunk/TSControlPanel/Program.cs
(Generate patch)

Comparing trunk/TSControlPanel/Program.cs (file contents):
Revision 64 by william, Thu Jul 12 17:34:46 2012 UTC vs.
Revision 65 by william, Thu Jul 12 19:07:58 2012 UTC

--- trunk/TSControlPanel/Program.cs	2012/07/12 18:56:31	64
+++ trunk/TSControlPanel/Program.cs	2012/07/12 19:07:58	65
@@ -17,6 +17,8 @@ namespace AnywhereTS
             currentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
             Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException, true);
 
+            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
+
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
 
@@ -24,6 +26,11 @@ namespace AnywhereTS
             objCustomDialogBox.dialogMode = frmClientProperties.ATSClientMode.CONTROL_PANEL; // Select the mode to run the form in.
             Application.Run(objCustomDialogBox);            
         }
+
+        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
+        {
+            CurrentDomain_UnhandledException(sender, new UnhandledExceptionEventArgs(e.Exception, false));
+        }
         static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs args)
         {
             Exception e = (Exception)args.ExceptionObject;