fa********@hotmail.com (Luke) wrote in message news:<cc**************************@posting.google. com>...
I have a program that exits just fine when you close it manually, but
throws an unhandled exception when I try to log off windows. It
suggests I enable the JIT debugger, but when I compile the program in
debug mode and enable JIT debugging it closes fine, though the logoff
process is aborted. I am using a couple of activex controls that .net
generated wrappers for, so I don't know if that has anything to do
with it, but my program closes fine manually and afaik windows calls
the same event when its trying to close a program.
Thanks in advance,
Luke
The text of the exception is:
System.NullReferenceException: Object reference not set to an instance
of an object.
at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.AxHost.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
I realize this is all very general but if someone could just point me
in the right direction I'd be grateful.