| re: Exception from opening and closing a form several hundred times
It sounds like the form is not being disposed or disposed
in a timely enough manner. You may want to try
calling .Dispose on form_unload().
Just a thought.
[color=blue]
>-----Original Message-----
>We're running Load Runner to test a large 1.0 based[/color]
WinForms application.[color=blue]
>I'm getting the following exception when opening and[/color]
closing a form 400 -[color=blue]
>450 times. The form contains several controls and custom[/color]
UserControls. All[color=blue]
>the code is native C#.
>
>I'm not making an explicit call to ToBitmap or DrawIcon[/color]
in my code. Can[color=blue]
>anyone help?
>
>
>Exception Caught in Main(): at[/color]
System.Drawing.Graphics.GetHdc()[color=blue]
>at System.Drawing.Icon.Draw(Graphics graphics, Rectangle[/color]
targetRect)[color=blue]
>at System.Drawing.Graphics.DrawIcon(Icon icon, Rectangle[/color]
targetRect)[color=blue]
>at System.Drawing.Icon.ToBitmap()
>at System.Windows.Forms.ThreadExceptionDialog..ctor[/color]
(Exception t)[color=blue]
>at System.Windows.Forms.ThreadExceptionDialog..ctor[/color]
(Exception t)[color=blue]
>at System.Windows.Forms.ThreadContext.OnThreadExcepti on[/color]
(Exception t)[color=blue]
>at System.Windows.Forms.Control.WndProcException[/color]
(Exception e)[color=blue]
>at[/color]
System.Windows.Forms.ControlNativeWindow.OnThreadE xception
(Exception e)[color=blue]
>at System.Windows.Forms.NativeWindow.Callback(IntPtr[/color]
hWnd, Int32 msg, IntPtr[color=blue]
>wparam, IntPtr lparam)
>at[/color]
System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW
(MSG& msg)[color=blue]
>at
>System.Windows.Forms.ComponentManager.System.Wind ows.Forms[/color]
..UnsafeNativeMetho[color=blue]
>ds+IMsoComponentManager.FPushMessageLoop(Int32[/color]
dwComponentID, Int32 reason,[color=blue]
>Int32 pvLoopData)
>at System.Windows.Forms.ThreadContext.RunMessageLoop[/color]
(Int32 reason,[color=blue]
>ApplicationContext context)
>at System.Windows.Forms.Application.Run(Form mainForm)
>at Insight.RepUI.Core.Launcher.Main()
>
>
>TIA,
>Eric Cadwell
>
>
>.
>[/color] |