Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Uncatchable Error!

Uncatchable Error!

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelpannouncement
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    usermans
    wrote on last edited by
    #1

    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).

    D M M 3 Replies Last reply
    0
    • U usermans

      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).

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      What's the code in your treeView's MouseDown/MouseClick/Click methods?

      1 Reply Last reply
      0
      • U usermans

        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).

        M Offline
        M Offline
        MarkB777
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • U usermans

          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).

          M Offline
          M Offline
          Matthew Butler 0
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups