Red "X" problem with Overflow error

A

Aaron Queenan

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.
 
P

Patrick O'Gorman

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)?
 
A

Aaron Queenan

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.
 
F

Frank Hileman

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
 
P

Patrick O'Gorman

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.
 
F

frank

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
 
H

Hadi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top