2012-10-30 7 views
1

나는 우리가 좀 끔찍하게 복잡한 코드가 Win32Exception에게Form.Shown 이후에 처리 오류가 발생할 수 있습니까?

을 만드는 중 오류 창 핸들을 던지고있는 문제가 있습니다.

는 호출 스택을 보면 나는

MainForm_ShownEvent(object sender, EventArgs e)//I Had a type-o here...arguments were wrong 
{ 
    someControl.Parent = contentPanel;//call starts here 
} 

스택의 상단은 사용자 정의 이벤트에서 유래에서 스택의 바닥은 참조하십시오. 이벤트 핸들러는 MainForm에 있습니다

anotherControl_RefreshEvent(object sender, PhysDocEventArgs e) 
{ 
    Text = titleBarText;//win32 exception 
} 

어떻게 가능합니까? Form.Shown이 호출되면 손잡이를 만들 수 있을까요?

업데이트

직접 실행 창 this.Handlethis는 MainForm 개체입니다 0입니다 알려줍니다.

스택 추적

System.Windows.Forms.NativeWindow.CreateHandle(System.Windows.Forms.CreateParams cp)  
    System.Windows.Forms.Control.CreateHandle() 
    System.Windows.Forms.Form.CreateHandle()  
    DevExpress.XtraEditors.XtraForm.CreateHandle() 
    System.Windows.Forms.Control.RecreateHandleCore() 
    System.Windows.Forms.Form.RecreateHandleCore() 
    System.Windows.Forms.Form.OnTextChanged(System.EventArgs e) 
    System.Windows.Forms.Control.Text.set(string value) 
    System.Windows.Forms.Form.Text.set(string value)  
> BHCS.ECC.PhysDoc.UI.Forms.MainForm.TemplateBaseControl_RefreshEvent(object sender = {BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl}, BHCS.ECC.PhysDoc.BL.PhysDocEventArgs e = {BHCS.ECC.PhysDoc.BL.PhysDocEventArgs}) Line 46 C# 
    BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RefreshControls() Line 323 C# 
    BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RunCreateControlProcess(bool destroyControls = false, bool reload = false, bool createControls = false, BHCS.ECC.PhysDoc.UI.LoadingForm loading = null) Line 1020 C# 
    BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.docNode_Resize(object sender = {BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl}, System.EventArgs e = {System.EventArgs}) Line 683 C# 
    System.Windows.Forms.Control.OnResize(System.EventArgs e) 
    System.Windows.Forms.UserControl.OnResize(System.EventArgs e) 
    BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.OnResize(System.EventArgs e = {System.EventArgs}) Line 140 C# 
    System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
    System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
    System.Windows.Forms.Control.UpdateBounds() 
    System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
    System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
    System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
    System.Windows.Forms.UserControl.WndProc(ref System.Windows.Forms.Message m)  
    System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
    System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
    System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
    [Native to Managed Transition] 
    [Managed to Native Transition] 
    System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Width) 
    System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
    System.Windows.Forms.Control.Width.set(int value) 
    BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RefreshControls() Line 332 C# 
    BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RunCreateControlProcess(bool destroyControls = false, bool reload = false, bool createControls = false, BHCS.ECC.PhysDoc.UI.LoadingForm loading = null) Line 1020 C# 
    BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.docNode_Resize(object sender = {BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl}, System.EventArgs e = {System.EventArgs}) Line 683 C# 
    System.Windows.Forms.Control.OnResize(System.EventArgs e) 
    System.Windows.Forms.UserControl.OnResize(System.EventArgs e) 
    BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.OnResize(System.EventArgs e = {System.EventArgs}) Line 140 C# 
    System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
    System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
    System.Windows.Forms.Control.UpdateBounds() 
    System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
    System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
    System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
    System.Windows.Forms.UserControl.WndProc(ref System.Windows.Forms.Message m)  
    System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
    System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
    System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
    [Native to Managed Transition] 
    [Managed to Native Transition] 
    System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Width) 
    System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
    System.Windows.Forms.Control.Width.set(int value) 
    BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RefreshControls() Line 332 C# 
    BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RunCreateControlProcess(bool destroyControls = false, bool reload = false, bool createControls = false, BHCS.ECC.PhysDoc.UI.LoadingForm loading = null) Line 1020 C# 
    BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.docNode_Resize(object sender = {BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl}, System.EventArgs e = {System.EventArgs}) Line 683 C# 
    System.Windows.Forms.Control.OnResize(System.EventArgs e) 
    System.Windows.Forms.UserControl.OnResize(System.EventArgs e) 
    BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.OnResize(System.EventArgs e = {System.EventArgs}) Line 140 C# 
    System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
    System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
    System.Windows.Forms.Control.UpdateBounds() 
    System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
    System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
    System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
    System.Windows.Forms.UserControl.WndProc(ref System.Windows.Forms.Message m)  
    System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
    System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
    System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
    [Native to Managed Transition] 
    [Managed to Native Transition] 
    System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Height)  
    System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
    System.Windows.Forms.Control.Height.set(int value) 
    BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.RefreshSize(bool setAnchorAndWidth = false) Line 109 C# 
    BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.ctrl_Resize(object sender = {System.Windows.Forms.Panel}, System.EventArgs e = {System.EventArgs}) Line 442 C# 
    System.Windows.Forms.Control.OnResize(System.EventArgs e) 
    System.Windows.Forms.Panel.OnResize(System.EventArgs eventargs) 
    System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
    System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
    System.Windows.Forms.Control.UpdateBounds() 
    System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
    System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  

(지운 부분은)

BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RefreshControls() Line 332 C# 
BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RunCreateControlProcess(bool destroyControls = false, bool reload = false, bool createControls = false, BHCS.ECC.PhysDoc.UI.LoadingForm loading = null) Line 1020 C# 
BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.docNode_Resize(object sender = {BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl}, System.EventArgs e = {System.EventArgs}) Line 683 C# 
System.Windows.Forms.Control.OnResize(System.EventArgs e) 
System.Windows.Forms.UserControl.OnResize(System.EventArgs e) 
BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.OnResize(System.EventArgs e = {System.EventArgs}) Line 140 C# 
System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
System.Windows.Forms.Control.UpdateBounds() 
System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.UserControl.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Height)  
System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
System.Windows.Forms.Control.Height.set(int value) 
BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.RefreshSize(bool setAnchorAndWidth = false) Line 109 C# 
BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.ctrl_Resize(object sender = {System.Windows.Forms.Panel}, System.EventArgs e = {System.EventArgs}) Line 442 C# 
System.Windows.Forms.Control.OnResize(System.EventArgs e) 
System.Windows.Forms.Panel.OnResize(System.EventArgs eventargs) 
System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
System.Windows.Forms.Control.UpdateBounds() 
System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Height)  
System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
System.Windows.Forms.Control.Height.set(int value) 
BHCS.ECC.PhysDoc.Plugins.Prompt.BL.PanelPrompt.pnlOuter_Layout(object sender = {System.Windows.Forms.Panel}, System.Windows.Forms.LayoutEventArgs e = {System.Windows.Forms.LayoutEventArgs}) Line 164 C# 
System.Windows.Forms.Control.OnLayout(System.Windows.Forms.LayoutEventArgs levent = {System.Windows.Forms.LayoutEventArgs}) 
System.Windows.Forms.ScrollableControl.OnLayout(System.Windows.Forms.LayoutEventArgs levent)  
System.Windows.Forms.Control.PerformLayout(System.Windows.Forms.LayoutEventArgs args) 
System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(System.Windows.Forms.Layout.IArrangedElement affectedElement, string affectedProperty) 
System.Windows.Forms.Control.OnResize(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Panel.OnResize(System.EventArgs eventargs) 
System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
System.Windows.Forms.Control.UpdateBounds() 
System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Width) 
System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
System.Windows.Forms.Control.Width.set(int value) 
BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.OnResize(System.EventArgs e = {System.EventArgs}) Line 150 C# 
System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
System.Windows.Forms.Control.UpdateBounds() 
System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.UserControl.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Width) 
System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
System.Windows.Forms.Control.Width.set(int value) 
BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RefreshControls() Line 332 C# 
BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RunCreateControlProcess(bool destroyControls = false, bool reload = false, bool createControls = false, BHCS.ECC.PhysDoc.UI.LoadingForm loading = null) Line 1020 C# 
BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.docNode_Resize(object sender = {BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl}, System.EventArgs e = {System.EventArgs}) Line 683 C# 
System.Windows.Forms.Control.OnResize(System.EventArgs e) 
System.Windows.Forms.UserControl.OnResize(System.EventArgs e) 
BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.OnResize(System.EventArgs e = {System.EventArgs}) Line 140 C# 
System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
System.Windows.Forms.Control.UpdateBounds() 
System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.UserControl.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Height)  
System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
System.Windows.Forms.Control.Height.set(int value) 
BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.RefreshSize(bool setAnchorAndWidth = false) Line 109 C# 
BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.ctrl_Resize(object sender = {System.Windows.Forms.Panel}, System.EventArgs e = {System.EventArgs}) Line 442 C# 
System.Windows.Forms.Control.OnResize(System.EventArgs e) 
System.Windows.Forms.Panel.OnResize(System.EventArgs eventargs) 
System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
System.Windows.Forms.Control.UpdateBounds() 
System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Height)  
System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
System.Windows.Forms.Control.Height.set(int value) 
BHCS.ECC.PhysDoc.Plugins.Prompt.BL.PanelPrompt.pnlOuter_Layout(object sender = {System.Windows.Forms.Panel}, System.Windows.Forms.LayoutEventArgs e = {System.Windows.Forms.LayoutEventArgs}) Line 164 C# 
System.Windows.Forms.Control.OnLayout(System.Windows.Forms.LayoutEventArgs levent = {System.Windows.Forms.LayoutEventArgs}) 
System.Windows.Forms.ScrollableControl.OnLayout(System.Windows.Forms.LayoutEventArgs levent)  
System.Windows.Forms.Control.PerformLayout(System.Windows.Forms.LayoutEventArgs args) 
System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(System.Windows.Forms.Layout.IArrangedElement affectedElement, string affectedProperty) 
System.Windows.Forms.Control.OnResize(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Panel.OnResize(System.EventArgs eventargs) 
System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
System.Windows.Forms.Control.UpdateBounds() 
System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Width) 
System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
System.Windows.Forms.Control.Width.set(int value) 
BHCS.ECC.PhysDoc.UI.UserControls.PDDocumentNodeControl.OnResize(System.EventArgs e = {System.EventArgs}) Line 150 C# 
System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
System.Windows.Forms.Control.UpdateBounds() 
System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.UserControl.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = Width) 
System.Windows.Forms.Control.SetBounds(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified) 
System.Windows.Forms.Control.Width.set(int value) 
BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RefreshControls() Line 332 C# 
BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.RunCreateControlProcess(bool destroyControls = false, bool reload = false, bool createControls = false, BHCS.ECC.PhysDoc.UI.LoadingForm loading = null) Line 1020 C# 
BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl.OnResize(System.EventArgs e = {System.EventArgs}) Line 1073 C# 
System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e = {System.EventArgs}) 
System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) 
System.Windows.Forms.Control.UpdateBounds() 
System.Windows.Forms.Control.WmWindowPosChanged(ref System.Windows.Forms.Message m = {System.Windows.Forms.Message})  
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.UserControl.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 71, System.IntPtr wparam, System.IntPtr lparam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
DevExpress.Utils.Win.Hook.ControlWndHook.WindowProc(System.IntPtr hWnd, int message, System.IntPtr wParam, System.IntPtr lParam)  
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Forms.Control.SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified = None) 
System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(System.Drawing.Rectangle bounds, System.Windows.Forms.BoundsSpecified specified)  
System.Windows.Forms.Layout.DefaultLayout.xLayoutDockedControl(System.Windows.Forms.Layout.IArrangedElement element, System.Drawing.Rectangle newElementBounds, bool measureOnly, ref System.Drawing.Size preferredSize, ref System.Drawing.Rectangle remainingBounds) 
System.Windows.Forms.Layout.DefaultLayout.LayoutDockedControls(System.Windows.Forms.Layout.IArrangedElement container, bool measureOnly = false)  
System.Windows.Forms.Layout.DefaultLayout.xLayout(System.Windows.Forms.Layout.IArrangedElement container = {System.Windows.Forms.Panel}, bool measureOnly = false, out System.Drawing.Size preferredSize = {Width = -7103 Height = -7105}) 
System.Windows.Forms.Layout.DefaultLayout.LayoutCore(System.Windows.Forms.Layout.IArrangedElement container, System.Windows.Forms.LayoutEventArgs args) 
System.Windows.Forms.Layout.LayoutEngine.Layout(object container, System.Windows.Forms.LayoutEventArgs layoutEventArgs) 
System.Windows.Forms.Control.OnLayout(System.Windows.Forms.LayoutEventArgs levent) 
System.Windows.Forms.ScrollableControl.OnLayout(System.Windows.Forms.LayoutEventArgs levent)  
System.Windows.Forms.Control.PerformLayout(System.Windows.Forms.LayoutEventArgs args) 
System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(System.Windows.Forms.Layout.IArrangedElement affectedElement, string affectedProperty) 
System.Windows.Forms.Control.ControlCollection.Add(System.Windows.Forms.Control value = {BHCS.ECC.PhysDoc.UI.UserControls.TemplateBaseControl}) 
System.Windows.Forms.Control.ParentInternal.set(System.Windows.Forms.Control value) 
System.Windows.Forms.Control.Parent.set(System.Windows.Forms.Control value) 
BHCS.ECC.PhysDoc.UI.Forms.MainForm.MainForm_Shown(object sender = {BHCS.ECC.PhysDoc.UI.Forms.MainForm}, System.EventArgs e = {System.EventArgs}) Line 88 C# 
System.Windows.Forms.Form.OnShown(System.EventArgs e) 
System.Windows.Forms.Form.CallShownEvent() 
System.Windows.Forms.Control.InvokeMarshaledCallbackDo(System.Windows.Forms.Control.ThreadMethodEntry tme) 
System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(object obj) 
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)  
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)  
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) 
System.Windows.Forms.Control.InvokeMarshaledCallback(System.Windows.Forms.Control.ThreadMethodEntry tme)  
System.Windows.Forms.Control.InvokeMarshaledCallbacks() 
System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.ContainerControl.WndProc(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Form.WndProc(ref System.Windows.Forms.Message m) 
DevExpress.XtraEditors.XtraForm.WndProc(ref System.Windows.Forms.Message msg) 
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) 
System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m)  
System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 49734, System.IntPtr wparam, System.IntPtr lparam) 
[Appdomain Transition] 
[Native to Managed Transition] 
[Managed to Native Transition] 
System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame = {System.Windows.Threading.DispatcherFrame}) Line 2281 Unknown 
System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) Line 368 Unknown 
System.Windows.Threading.Dispatcher.Run() Line 327 Unknown 
System.Windows.Application.RunDispatcher(object ignore) Line 2745 C# 
System.Windows.Application.RunInternal(System.Windows.Window window) Line 1841 C# 
System.Windows.Application.Run(System.Windows.Window window) Line 261 C# 
Eclipsys.Infrastructure.UIShell.App.Main() 
+0

아마도 폼 자체의 핸들이 아니라 문제가있는 폼의 컨트롤 핸들입니다. –

+0

@SteveWellens - titleBarText는 문자열 객체입니다. Text는'MainForm.Text'의 속성입니다. 이 코드 줄에는 아무런 통제도 포함되어 있지 않기 때문에 불가능하다고 나는 믿는다. –

+0

핸들을 확인할 수 있습니다.이 값은 무엇입니까? 핸들? 양식에 많은 컨트롤이 있습니까? 일시적으로 모두 삭제하고 문제가 사라지는 지 확인할 수 있습니다. –

답변

2

이있다 예외입니다 (이것은 19 페이지입니다 일부를 삭제했다) 쉬운 진단 및 매우 일반적인 원인. 작업 관리자, 프로세스 탭을 사용하여 진단을 시작하십시오. 보기 + 열 선택, 사용자 개체 틱. 당신이 그것에있는 동안 GDI Objects와 Handle을 똑딱 거리십시오. 프로그램을 실행하고 프로그램의 기능을 사용하는 동안 프로세스의 USER 개체 값을 관찰하십시오.

표시되는 값이 꾸준히 등반하면 프로그램에서 창 핸들이 누출됩니다. 일단 값이 10000에 도달하면 Windows는 더 많은 윈도우를 제공하지 않고 프로세스는 할당량을 소비합니다. 그 예외는 "창 핸들을 만드는 중 오류"입니다.

원인은 Winforms에서 매우 일반적인 프로그래밍 실수입니다. Controls.Remove/At() 또는 Controls.Clear()를 사용하여 부모로부터 컨트롤을 제거하지만 제거 된 컨트롤에 Dispose() 메서드를 호출하는 것을 잊지 마십시오. 그 (것)들은 영원히 살게하고, 그들의 창 손잡이에 의해 살아있게 할 것입니다.

+0

+1 나는 이것을 파헤쳐 볼 것이다. 과거에 우리가 겪었던 오류로 인해 이것은 매우 유망한 것으로 들립니다! –

+0

예외가 발생하는 지점에 10,000 개가 아닙니다. 핸들/사용자 개체/GDI는 각각 1278/1376/799입니다. –

+0

예외의 전체 스택 추적을 게시하십시오. 관리되지 않는 디버깅을 활성화하고 Microsoft Symbols Server를 활성화하여 원시 스택 프레임을 볼 수도 있습니다. –

관련 문제