By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,721 Members | 1,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,721 IT Pros & Developers. It's quick & easy.

Exception from opening and closing a form several hundred times

P: n/a
We're running Load Runner to test a large 1.0 based WinForms application.
I'm getting the following exception when opening and closing a form 400 -
450 times. The form contains several controls and custom UserControls. All
the code is native C#.

I'm not making an explicit call to ToBitmap or DrawIcon in my code. Can
anyone help?
Exception Caught in Main(): at System.Drawing.Graphics.GetHdc()
at System.Drawing.Icon.Draw(Graphics graphics, Rectangle targetRect)
at System.Drawing.Graphics.DrawIcon(Icon icon, Rectangle targetRect)
at System.Drawing.Icon.ToBitmap()
at System.Windows.Forms.ThreadExceptionDialog..ctor(E xception t)
at System.Windows.Forms.ThreadExceptionDialog..ctor(E xception t)
at System.Windows.Forms.ThreadContext.OnThreadExcepti on(Exception t)
at System.Windows.Forms.Control.WndProcException(Exce ption e)
at System.Windows.Forms.ControlNativeWindow.OnThreadE xception(Exception e)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMetho
ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason,
Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Insight.RepUI.Core.Launcher.Main()
TIA,
Eric Cadwell
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
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.
-----Original Message-----
We're running Load Runner to test a large 1.0 based WinForms application.I'm getting the following exception when opening and closing a form 400 -450 times. The form contains several controls and custom UserControls. Allthe code is native C#.

I'm not making an explicit call to ToBitmap or DrawIcon in my code. Cananyone help?
Exception Caught in Main(): at System.Drawing.Graphics.GetHdc()at System.Drawing.Icon.Draw(Graphics graphics, Rectangle targetRect)at System.Drawing.Graphics.DrawIcon(Icon icon, Rectangle targetRect)at System.Drawing.Icon.ToBitmap()
at System.Windows.Forms.ThreadExceptionDialog..ctor (Exception t)at System.Windows.Forms.ThreadExceptionDialog..ctor (Exception t)at System.Windows.Forms.ThreadContext.OnThreadExcepti on (Exception t)at System.Windows.Forms.Control.WndProcException (Exception e)at System.Windows.Forms.ControlNativeWindow.OnThreadE xception
(Exception e)at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtrwparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW
(MSG& msg)at
System.Windows.Forms.ComponentManager.System.Wind ows.Forms ..UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason,Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoop (Int32 reason,ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Insight.RepUI.Core.Launcher.Main()
TIA,
Eric Cadwell
.

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.