Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs	(revision 1121)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs	(revision 1122)
@@ -1296,4 +1296,10 @@
         }
 
+        //DON'T USE OBVIOUSLY. JUST FOR TESTING.
+        public void ThrowException()
+        {
+            throw new Exception("Hello World. I am an Exception.");
+        }
+
         #endregion Methods
 
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs	(revision 1121)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs	(revision 1122)
@@ -186,4 +186,11 @@
         static void Main(string[] args)
         {
+            //Application wide error handler for unhandled errors (later I figure out that's only for WinForm ex'es)
+            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
+            Application.ThreadException += new ThreadExceptionEventHandler(App_ThreadException);
+
+            // Add the event handler for handling non-UI thread exceptions to the event. 
+            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(App_DomainException);
+
 #if DEBUG
             // Print console messages to console if launched from console
@@ -231,6 +238,7 @@
             Application.DoEvents();
 
-            //Application wide error handler for unhandled errors
-            Application.ThreadException += new ThreadExceptionEventHandler(App_ThreadException);
+            //test
+            //doc.ThrowException();
+            //test
 
 #if TRACE
@@ -247,16 +255,11 @@
 
         /// <summary>
-        /// Exception handler for application errors. TODO: Test
-        /// </summary>
+        /// Exception handler for application errors. Only for WinForm Errors.
+        /// </summary>
+        /// <remarks>Never tested. I can't get an error to go here!</remarks>
         /// <param name="sender"></param>
         /// <param name="e"></param>
         static void App_ThreadException(object sender, ThreadExceptionEventArgs e)
         {
-            if (e.Exception is System.Net.Sockets.SocketException)
-            {
-                MessageBox.Show("Looks like we lost our connection with the server\nClick OK to terminate the application.");
-                Application.Exit();
-            }
-
             string msg = "A problem has occured in this applicaton. \r\n\r\n" +
                 "\t" + e.Exception.Message + "\r\n\r\n" +
@@ -269,4 +272,25 @@
         }
 
+        /// <summary>
+        /// If we are here, we are dead meat.
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        static void App_DomainException(object sender, UnhandledExceptionEventArgs e)
+        {
+            if (e.ExceptionObject is System.Net.Sockets.SocketException)
+            {
+                MessageBox.Show("Looks like we lost our connection with the server\nClick OK to terminate the application.");
+            }
+            else
+            {
+                Exception ex = e.ExceptionObject as Exception;
+
+                string msg = "A problem has occured in this applicaton. \r\n\r\n" +
+                    "\t" + ex.InnerException.Message;
+
+                MessageBox.Show(msg, "Unexpected Error");
+            }
+        }// here application terminates
 
         #region BMXNet Event Handler
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user	(revision 1121)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj.user	(revision 1122)
@@ -37,5 +37,6 @@
     </RemoteDebugMachine>
     <StartAction>Project</StartAction>
-    <StartArguments>/s=192.168.56.101 /p=9260 /a=shabiel12 /v=catdog.77</StartArguments>
+    <StartArguments>
+    </StartArguments>
     <StartPage>
     </StartPage>
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.sln
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.sln	(revision 1121)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.sln	(revision 1122)
@@ -11,10 +11,10 @@
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.ActiveCfg = Release|Any CPU
-		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.Build.0 = Release|Any CPU
+		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.Build.0 = Release|Any CPU
-		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.ActiveCfg = Release|Any CPU
-		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.Build.0 = Release|Any CPU
+		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.Build.0 = Release|Any CPU
