K
Kenny Carruthers
Just wondering if someone could shed some light on what might be causing
the following problem:
I have a main window that is an MdiContainer. There is a "Windows" menu
that I populate myself and handle the events.
The problem is that every once in awhile, my application deadlocks when the
user selects a window from the menu and
the application tries to show() it. The code for showing it does nothing for
then look through an ArrayList of windows, finds the one
matching name, then calls:
(Handle in a basic menu_click event handler in the MDI Parent form)
window.MdiParent = this;
window.Show();
Right after the Show(), the application freezes. If I "Pause" it in the
debugger at this state, the CallStack
is the following:
system.windows.forms.dll!System.Windows.Forms.Control::SetParentHandle
system.windows.forms.dll!System.Windows.Forms.Control::CreateControl
system.windows.forms.dll!System.Windows.Forms.Control::CreateControl
system.windows.forms.dll!System.Windows.Forms.Control::WmShowWindow
system.windows.forms.dll!System.Windows.Forms.Control::WndProc
system.windows.forms.dll!System.Windows.Forms.ScrollableControl::WndProc
system.windows.forms.dll!System.Windows.Forms.ContainerControl::WndProc
system.windows.forms.dll!System.Windows.Forms.Form::WmShowWindow
system.windows.forms.dll!System.Windows.Forms.Form::WndProc
system.windows.forms.dll!ControlNativeWindow::OnMessage
system.windows.forms.dll!ControlNativeWindow::WndProc
system.windows.forms.dll!System.Windows.Forms.NativeWindow:ebuggableCallba
ck
system.windows.forms.dll!System.Windows.Forms.UnsafeNativeMethods::CreateWin
dowEx
system.windows.forms.dll!System.Windows.Forms.NativeWindow::CreateHandle
system.windows.forms.dll!System.Windows.Forms.Control::CreateHandle
system.windows.forms.dll!System.Windows.Forms.Form::CreateHandle
system.windows.forms.dll!System.Windows.Forms.Control::get_Handle
system.windows.forms.dll!System.Windows.Forms.Form::SetVisibleCore
system.windows.forms.dll!System.Windows.Forms.Control::set_Visible
system.windows.forms.dll!System.Windows.Forms.Control::Show()
EPro.exe!D2Pro.MainWindow.WindowsContainerMenuItem_Click
There's nothing fancy going on when I show this window that I can see
would cause a deadlock in my code.
The only thing that I can think of, is that one of the controls in the
window being show'n makes some InterOp
calls in its OnPaint() routine and uses the handle to the device context for
calling a few routines. Could this be causing the
call stack above?
Since this doesn't happen all the time, it's proving to be pretty
challenging to track down. Any help would be appreciated.
Thank you,
Kenny
the following problem:
I have a main window that is an MdiContainer. There is a "Windows" menu
that I populate myself and handle the events.
The problem is that every once in awhile, my application deadlocks when the
user selects a window from the menu and
the application tries to show() it. The code for showing it does nothing for
then look through an ArrayList of windows, finds the one
matching name, then calls:
(Handle in a basic menu_click event handler in the MDI Parent form)
window.MdiParent = this;
window.Show();
Right after the Show(), the application freezes. If I "Pause" it in the
debugger at this state, the CallStack
is the following:
system.windows.forms.dll!System.Windows.Forms.Control::SetParentHandle
system.windows.forms.dll!System.Windows.Forms.Control::CreateControl
system.windows.forms.dll!System.Windows.Forms.Control::CreateControl
system.windows.forms.dll!System.Windows.Forms.Control::WmShowWindow
system.windows.forms.dll!System.Windows.Forms.Control::WndProc
system.windows.forms.dll!System.Windows.Forms.ScrollableControl::WndProc
system.windows.forms.dll!System.Windows.Forms.ContainerControl::WndProc
system.windows.forms.dll!System.Windows.Forms.Form::WmShowWindow
system.windows.forms.dll!System.Windows.Forms.Form::WndProc
system.windows.forms.dll!ControlNativeWindow::OnMessage
system.windows.forms.dll!ControlNativeWindow::WndProc
system.windows.forms.dll!System.Windows.Forms.NativeWindow:ebuggableCallba
ck
system.windows.forms.dll!System.Windows.Forms.UnsafeNativeMethods::CreateWin
dowEx
system.windows.forms.dll!System.Windows.Forms.NativeWindow::CreateHandle
system.windows.forms.dll!System.Windows.Forms.Control::CreateHandle
system.windows.forms.dll!System.Windows.Forms.Form::CreateHandle
system.windows.forms.dll!System.Windows.Forms.Control::get_Handle
system.windows.forms.dll!System.Windows.Forms.Form::SetVisibleCore
system.windows.forms.dll!System.Windows.Forms.Control::set_Visible
system.windows.forms.dll!System.Windows.Forms.Control::Show()
EPro.exe!D2Pro.MainWindow.WindowsContainerMenuItem_Click
There's nothing fancy going on when I show this window that I can see
would cause a deadlock in my code.
The only thing that I can think of, is that one of the controls in the
window being show'n makes some InterOp
calls in its OnPaint() routine and uses the handle to the device context for
calling a few routines. Could this be causing the
call stack above?
Since this doesn't happen all the time, it's proving to be pretty
challenging to track down. Any help would be appreciated.
Thank you,
Kenny