Uncatchable Error!
-
Hello, I am using the TreeView control (version 2.0) in a Visual Studio 2008 Windows application. Everything works fine on the development computer but when I deploy the program to the client's machine the control produces the following error when the user makes a few clicks on the nodes: ///////////////////////////////////////////////////// See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.DivideByZeroException: Attempted to divide by zero. at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at System.Windows.Forms.Control.DefWndProc(Message& m) at System.Windows.Forms.TreeView.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.TreeView.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- CarRent Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Program%20Files/ISS/CarRent%20Setup/CarRent.exe ---------------------------------------- //////////////////////////////////////////// I couldn't find any reasonable cause for this error, and I couldn't catch it! I surrounded all my code with try/catch blocks and none of them was able to catch the error! One more thing to mention, the project that contains the control was originally developed in VS 2005 and then converted to VS 2008 format (I don't know if this has anything to do with the error, but I mentioned it, just in case).
-
Hello, I am using the TreeView control (version 2.0) in a Visual Studio 2008 Windows application. Everything works fine on the development computer but when I deploy the program to the client's machine the control produces the following error when the user makes a few clicks on the nodes: ///////////////////////////////////////////////////// See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.DivideByZeroException: Attempted to divide by zero. at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at System.Windows.Forms.Control.DefWndProc(Message& m) at System.Windows.Forms.TreeView.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.TreeView.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- CarRent Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Program%20Files/ISS/CarRent%20Setup/CarRent.exe ---------------------------------------- //////////////////////////////////////////// I couldn't find any reasonable cause for this error, and I couldn't catch it! I surrounded all my code with try/catch blocks and none of them was able to catch the error! One more thing to mention, the project that contains the control was originally developed in VS 2005 and then converted to VS 2008 format (I don't know if this has anything to do with the error, but I mentioned it, just in case).
-
Hello, I am using the TreeView control (version 2.0) in a Visual Studio 2008 Windows application. Everything works fine on the development computer but when I deploy the program to the client's machine the control produces the following error when the user makes a few clicks on the nodes: ///////////////////////////////////////////////////// See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.DivideByZeroException: Attempted to divide by zero. at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at System.Windows.Forms.Control.DefWndProc(Message& m) at System.Windows.Forms.TreeView.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.TreeView.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- CarRent Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Program%20Files/ISS/CarRent%20Setup/CarRent.exe ---------------------------------------- //////////////////////////////////////////// I couldn't find any reasonable cause for this error, and I couldn't catch it! I surrounded all my code with try/catch blocks and none of them was able to catch the error! One more thing to mention, the project that contains the control was originally developed in VS 2005 and then converted to VS 2008 format (I don't know if this has anything to do with the error, but I mentioned it, just in case).
That's weird.. it looks like a DivideByZeroException...~! Is the code dividing values? Maybe you could set up an if statement to say if the denominator is 0 then throw a custom exception? Have you tryed using the step-by-step debugger to see what line is throwing the exception? Mark.
-
Hello, I am using the TreeView control (version 2.0) in a Visual Studio 2008 Windows application. Everything works fine on the development computer but when I deploy the program to the client's machine the control produces the following error when the user makes a few clicks on the nodes: ///////////////////////////////////////////////////// See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.DivideByZeroException: Attempted to divide by zero. at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at System.Windows.Forms.Control.DefWndProc(Message& m) at System.Windows.Forms.TreeView.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.TreeView.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- CarRent Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Program%20Files/ISS/CarRent%20Setup/CarRent.exe ---------------------------------------- //////////////////////////////////////////// I couldn't find any reasonable cause for this error, and I couldn't catch it! I surrounded all my code with try/catch blocks and none of them was able to catch the error! One more thing to mention, the project that contains the control was originally developed in VS 2005 and then converted to VS 2008 format (I don't know if this has anything to do with the error, but I mentioned it, just in case).
I have had this error before when using mono... The scrollbar in the treeview (I beleive), whilst trying to calculate its position and size, is causing the divide-by-zero exception. I think I solved this by setting the scrollbars to be always visible. But as I say, this was with mono so this may not work under your circumstances. (You could try installing the latest verion of .net on the target machine). Hope this helps.
Matthew Butler