G
Guest
At random times in my C# WinForms app in .NET 1.1, I will get the following
stack trace:
System.NullReferenceException: Object reference not set to an instance
of an object.
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.Control.WmUpdateUIState(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.ParkingWindow.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
It seems to occur outside of any of my code so I can't handle the
exception. My main() is STA. Is there anything I can do to stop this or at
least handle the exception. The problem is that the exception even skips
over the AppDomain.CurrentDomain.UnhandledException event. I would think
that the exception would be occurring on the current AppDomain so it should
be handled by this event but it seems to skip this event. Is this exception
on a different AppDomain??? BTW, I also handle Application.ThreadException
but it doesn't go there either.
Thanks,
Ashton Hobbs
(e-mail address removed)
stack trace:
System.NullReferenceException: Object reference not set to an instance
of an object.
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.Control.WmUpdateUIState(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.ParkingWindow.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
It seems to occur outside of any of my code so I can't handle the
exception. My main() is STA. Is there anything I can do to stop this or at
least handle the exception. The problem is that the exception even skips
over the AppDomain.CurrentDomain.UnhandledException event. I would think
that the exception would be occurring on the current AppDomain so it should
be handled by this event but it seems to skip this event. Is this exception
on a different AppDomain??? BTW, I also handle Application.ThreadException
but it doesn't go there either.
Thanks,
Ashton Hobbs
(e-mail address removed)