A
Andi
Hi,
This post is related to my previous post:
http://groups.google.com/group/micr...read/thread/aa7a7b3583685f4f/9c5c930a0396b35b
In the C# application that I'm working on, we keep getting these
random instances where it just throws a 'Win32Exception' out of
nowhere saying that it failed to create the error handle. The most
common stack trace that we get is:
System.ComponentModel.Win32Exception: Error creating window handle.
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Timer.TimerNativeWindow.EnsureHandle()
at System.Windows.Forms.Timer.TimerNativeWindow.StartTimer(Int32
interval)
at System.Windows.Forms.Timer.set_Enabled(Boolean value)
at System.Windows.Forms.MouseHoverTimer.Start(ToolStripItem item)
at System.Windows.Forms.ToolStrip.OnMouseMove(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.MenuStrip.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)
In the most recent occurrence of this issue, the app was just idle,
the user wasn't doing anything and suddenly it crashed with the above
exception and stacktrace.
I've done a lot of profiling and cleanup in the app, so it's properly
disposing and releasing no longer used objects. I also know that the
number of open window handles for the process was only 543 and the
memory for it was around 75MB. So I know that we didn't run out of
window handles or memory.
What else could be causing such an exception? Or what else would
explain it?
One thing that we're doing differently in this app that I haven't done
in any other app before is that when the app is launched, we don't use
the 'Application' class but rather have a class derived from
'Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase'.
That class is taking care of running the main UI thread.
Could this base class somehow be causing these issues? Would it be
better to just use 'Application.Run' instead?
Any ideas/suggestions would be great as we've just hit a wall with
this issue now.
Thanks.
Andi
This post is related to my previous post:
http://groups.google.com/group/micr...read/thread/aa7a7b3583685f4f/9c5c930a0396b35b
In the C# application that I'm working on, we keep getting these
random instances where it just throws a 'Win32Exception' out of
nowhere saying that it failed to create the error handle. The most
common stack trace that we get is:
System.ComponentModel.Win32Exception: Error creating window handle.
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Timer.TimerNativeWindow.EnsureHandle()
at System.Windows.Forms.Timer.TimerNativeWindow.StartTimer(Int32
interval)
at System.Windows.Forms.Timer.set_Enabled(Boolean value)
at System.Windows.Forms.MouseHoverTimer.Start(ToolStripItem item)
at System.Windows.Forms.ToolStrip.OnMouseMove(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.MenuStrip.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)
In the most recent occurrence of this issue, the app was just idle,
the user wasn't doing anything and suddenly it crashed with the above
exception and stacktrace.
I've done a lot of profiling and cleanup in the app, so it's properly
disposing and releasing no longer used objects. I also know that the
number of open window handles for the process was only 543 and the
memory for it was around 75MB. So I know that we didn't run out of
window handles or memory.
What else could be causing such an exception? Or what else would
explain it?
One thing that we're doing differently in this app that I haven't done
in any other app before is that when the app is launched, we don't use
the 'Application' class but rather have a class derived from
'Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase'.
That class is taking care of running the main UI thread.
Could this base class somehow be causing these issues? Would it be
better to just use 'Application.Run' instead?
Any ideas/suggestions would be great as we've just hit a wall with
this issue now.
Thanks.
Andi