Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / March 2004

Tip: Looking for answers? Try searching our database.

Red "X" problem with Overflow error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aaron Queenan - 03 Mar 2004 12:01 GMT
I have am writing .NET application which uses COM interop.

Sometimes, while pressing buttons or interacting with the controls, an
unhandled exception message appears due to an "Overflow error", with the
information below.  It always appears while drawing the form, but happens
with different controls each time, and the control that was drawing at the
time is replaced with a red "X" on a white background.

I have searched the internet for any suggestions, but can't find anything
that suggests what could be causing the problem.  The only lead I have is
that it seems to happen with Windows XP themes are enabled, but doesn't
happen if the default "teletubbies" theme is used.

Do you have any suggestions about how to fix this problem, or even what the
error means?

Thanks,
Aaron Queenan.

-----

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.OverflowException: Overflow error.
  at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
  at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush,
RectangleF layoutRectangle, StringFormat format)
  at System.Windows.Forms.ControlPaint.DrawStringDisabled(Graphics
graphics, String s, Font font, Color color, RectangleF layoutRectangle,
StringFormat format)
  at System.Windows.Forms.GroupBox.OnPaint(PaintEventArgs e)
  at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
  at System.Windows.Forms.Control.WmPaint(Message& m)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.GroupBox.WndProc(Message& m)
  at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   CodeBase:
file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
System
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   CodeBase:
file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
Extensibility
   Assembly Version: 7.0.3300.0
   Win32 Version: 7.00.9466
   CodeBase: file:///E:/MKVIEW/SNAPPER/Excell_Plugin/Bin/Extensibility.DLL
----------------------------------------
System.Drawing
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   CodeBase:
file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Windows.Forms
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   CodeBase:
file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
CustomMarshalers
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   CodeBase:
file:///c:/windows/assembly/gac/custommarshalers/1.0.5000.0__b03f5f7f11d50a3a/custommarshalers.dll
----------------------------------------
<snip>
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
   <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
Patrick O'Gorman - 03 Mar 2004 13:52 GMT
i have a post below that seeks to find the answer to the big red x problem.
so far nothing.  i have scoured google groups and ms newsgroups...to no
avail.

so far all i have heard is that it may be an error in a control's paint
logic.  are you using any thrid-party controls (our red x occurs in place of
an infragistics grid)?  are you running over an application server (our red
x 99.9% of the time only occurs over citrix ica)?

> I have am writing .NET application which uses COM interop.
>
[quoted text clipped - 50 lines]
>     Win32 Version: 1.1.4322.573
>     CodeBase:

file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
> ----------------------------------------
> Extensibility
>     Assembly Version: 7.0.3300.0
>     Win32 Version: 7.00.9466
>     CodeBase:
file:///E:/MKVIEW/SNAPPER/Excell_Plugin/Bin/Extensibility.DLL
> ----------------------------------------
> System.Drawing
>     Assembly Version: 1.0.5000.0
>     Win32 Version: 1.1.4322.573
>     CodeBase:

file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
> ----------------------------------------
> System.Windows.Forms
>     Assembly Version: 1.0.5000.0
>     Win32 Version: 1.1.4322.573
>     CodeBase:

file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
> ----------------------------------------
> CustomMarshalers
>     Assembly Version: 1.0.5000.0
>     Win32 Version: 1.1.4322.573
>     CodeBase:

file:///c:/windows/assembly/gac/custommarshalers/1.0.5000.0__b03f5f7f11d50a3a/custommarshalers.dll
> ----------------------------------------
> <snip>
[quoted text clipped - 16 lines]
> will be sent to the JIT debugger registered on the machine
> rather than being handled by this dialog.
Aaron Queenan - 03 Mar 2004 18:37 GMT
Absolutely no third party controls are being used.  I have seen the problem
occur with the .NET form, combobox and groupbox, always from the DrawString
method.

We are running the application on the local system.  It's actually and Excel
Plug-in, but the red "X" occurs even if I make it a standalone application.

Thanks,
Aaron.

> i have a post below that seeks to find the answer to the big red x problem.
> so far nothing.  i have scoured google groups and ms newsgroups...to no
[quoted text clipped - 61 lines]
> >     Win32 Version: 1.1.4322.573
> >     CodeBase:

file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
> > ----------------------------------------
> > Extensibility
[quoted text clipped - 7 lines]
> >     Win32 Version: 1.1.4322.573
> >     CodeBase:

file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
> > ----------------------------------------
> > System.Windows.Forms
> >     Assembly Version: 1.0.5000.0
> >     Win32 Version: 1.1.4322.573
> >     CodeBase:

file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
> > ----------------------------------------
> > CustomMarshalers
> >     Assembly Version: 1.0.5000.0
> >     Win32 Version: 1.1.4322.573
> >     CodeBase:

file:///c:/windows/assembly/gac/custommarshalers/1.0.5000.0__b03f5f7f11d50a3a/custommarshalers.dll
> > ----------------------------------------
> > <snip>
[quoted text clipped - 16 lines]
> > will be sent to the JIT debugger registered on the machine
> > rather than being handled by this dialog.
Frank Hileman - 03 Mar 2004 19:47 GMT
The red X appears when an exception is thrown and not caught in a Paint
event or OnPaint function. Essentially, it indicates a programming error --
developers must catch all exceptions.

Regards,
Frank Hileman

check out VG.net: www.vgdotnet.com
Animated vector graphics system
Integrated VS.net graphics editor

> Absolutely no third party controls are being used.  I have seen the problem
> occur with the .NET form, combobox and groupbox, always from the DrawString
[quoted text clipped - 61 lines]
> > >    at System.Windows.Forms.GroupBox.OnPaint(PaintEventArgs e)
> > >    at
System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs
> > e,
> > > Int16 layer, Boolean disposeEventArgs)
[quoted text clipped - 17 lines]
> > >     Win32 Version: 1.1.4322.573
> > >     CodeBase:

file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
> > > ----------------------------------------
> > > Extensibility
[quoted text clipped - 7 lines]
> > >     Win32 Version: 1.1.4322.573
> > >     CodeBase:

file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
> > > ----------------------------------------
> > > System.Windows.Forms
> > >     Assembly Version: 1.0.5000.0
> > >     Win32 Version: 1.1.4322.573
> > >     CodeBase:

file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
> > > ----------------------------------------
> > > CustomMarshalers
> > >     Assembly Version: 1.0.5000.0
> > >     Win32 Version: 1.1.4322.573
> > >     CodeBase:

file:///c:/windows/assembly/gac/custommarshalers/1.0.5000.0__b03f5f7f11d50a3a/custommarshalers.dll
> > > ----------------------------------------
> > > <snip>
[quoted text clipped - 16 lines]
> > > will be sent to the JIT debugger registered on the machine
> > > rather than being handled by this dialog.
Patrick O'Gorman - 03 Mar 2004 20:53 GMT
Frank, thanks for your reply first of all.  Second, this error is being
thrown outside of any code I have written and can wrap in a try/catch.
Basically there is no way for me to catch this error as it happens after the
last line of my code executes.  I have even tried wrapping the entire
controlling method if you will in a try catch.  End sub comes and goes and
all is good...but then...bam...there's the red X.

thoughts?

thanks again.

> The red X appears when an exception is thrown and not caught in a Paint
> event or OnPaint function. Essentially, it indicates a programming error --
[quoted text clipped - 104 lines]
> > > >     Win32 Version: 1.1.4322.573
> > > >     CodeBase:

file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
> > > > ----------------------------------------
> > > > Extensibility
[quoted text clipped - 7 lines]
> > > >     Win32 Version: 1.1.4322.573
> > > >     CodeBase:

file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
> > > > ----------------------------------------
> > > > System.Windows.Forms
> > > >     Assembly Version: 1.0.5000.0
> > > >     Win32 Version: 1.1.4322.573
> > > >     CodeBase:

file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
> > > > ----------------------------------------
> > > > CustomMarshalers
> > > >     Assembly Version: 1.0.5000.0
> > > >     Win32 Version: 1.1.4322.573
> > > >     CodeBase:

file:///c:/windows/assembly/gac/custommarshalers/1.0.5000.0__b03f5f7f11d50a3a/custommarshalers.dll
> > > > ----------------------------------------
> > > > <snip>
[quoted text clipped - 16 lines]
> > > > will be sent to the JIT debugger registered on the machine
> > > > rather than being handled by this dialog.
frank - 03 Mar 2004 22:37 GMT
One of the parameters to DrawString is invalid in the GroupBox OnPaint code,
that is drawing a disabled label. That is all you can tell from the stack
trace. You will need to speak with the code author. If the author is MS, I
suppose you found a bug. Otherwise, all you can do is guess and play until
the problem might disappear. Perhaps change the font on the GroupBox, or
prevent it from becoming disabled.

- Frank

> Frank, thanks for your reply first of all.  Second, this error is being
> thrown outside of any code I have written and can wrap in a try/catch.
[quoted text clipped - 97 lines]
> > > > > RectangleF layoutRectangle, StringFormat format)
> > > > >    at
System.Windows.Forms.ControlPaint.DrawStringDisabled(Graphics
> > > > > graphics, String s, Font font, Color color, RectangleF
> > layoutRectangle,
[quoted text clipped - 24 lines]
> > > > >     Win32 Version: 1.1.4322.573
> > > > >     CodeBase:

file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
> > > > > ----------------------------------------
> > > > > Extensibility
[quoted text clipped - 7 lines]
> > > > >     Win32 Version: 1.1.4322.573
> > > > >     CodeBase:

file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
> > > > > ----------------------------------------
> > > > > System.Windows.Forms
> > > > >     Assembly Version: 1.0.5000.0
> > > > >     Win32 Version: 1.1.4322.573
> > > > >     CodeBase:

file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
> > > > > ----------------------------------------
> > > > > CustomMarshalers
> > > > >     Assembly Version: 1.0.5000.0
> > > > >     Win32 Version: 1.1.4322.573
> > > > >     CodeBase:

file:///c:/windows/assembly/gac/custommarshalers/1.0.5000.0__b03f5f7f11d50a3a/custommarshalers.dll
> > > > > ----------------------------------------
> > > > > <snip>
[quoted text clipped - 16 lines]
> > > > > will be sent to the JIT debugger registered on the machine
> > > > > rather than being handled by this dialog.
Hadi - 04 Mar 2004 02:25 GMT
Hello,

Make sure that you do your code change inside the GUI thread. In .Net GUI
thread is separate with the application thread. I used to get this problem
until I marshall all my changes (to the UI) inside the GUI thread. However
you must be careful about which code you process in GUI thread/other threads
as if you put too much processing in GUI thread it would seem that your
application locks up.

The keyword you should look at is the control.Invoke() search it on
MSDN/Doco.

Hadi

> Frank, thanks for your reply first of all.  Second, this error is being
> thrown outside of any code I have written and can wrap in a try/catch.
[quoted text clipped - 97 lines]
> > > > > RectangleF layoutRectangle, StringFormat format)
> > > > >    at
System.Windows.Forms.ControlPaint.DrawStringDisabled(Graphics
> > > > > graphics, String s, Font font, Color color, RectangleF
> > layoutRectangle,
[quoted text clipped - 24 lines]
> > > > >     Win32 Version: 1.1.4322.573
> > > > >     CodeBase:

file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
> > > > > ----------------------------------------
> > > > > Extensibility
[quoted text clipped - 7 lines]
> > > > >     Win32 Version: 1.1.4322.573
> > > > >     CodeBase:

file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
> > > > > ----------------------------------------
> > > > > System.Windows.Forms
> > > > >     Assembly Version: 1.0.5000.0
> > > > >     Win32 Version: 1.1.4322.573
> > > > >     CodeBase:

file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
> > > > > ----------------------------------------
> > > > > CustomMarshalers
> > > > >     Assembly Version: 1.0.5000.0
> > > > >     Win32 Version: 1.1.4322.573
> > > > >     CodeBase:

file:///c:/windows/assembly/gac/custommarshalers/1.0.5000.0__b03f5f7f11d50a3a/custommarshalers.dll
> > > > > ----------------------------------------
> > > > > <snip>
[quoted text clipped - 16 lines]
> > > > > will be sent to the JIT debugger registered on the machine
> > > > > rather than being handled by this dialog.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.