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

help!

P: n/a
Hi
I met problems with C# lately.
I create a new project with C# and press F5 (or press button start)
This program start without error but whenever I insert a button in form
In this program occurred an error and I don't understand why occurred this error!!!!
Help me!
This error included four buttons: Break, Continue, Ignore (inactive) and Help
that none of buttons don't display correct result,why really?
***********************************text error**********************************
" An unhandled exception of type 'System.ArithmeticException'occurred in

system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation."
************************************************** *****************************
Email: fs*************@yahoo.com
Best regards,
Fatemeh Hashemian
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Select the button "Break" and see what line of code the debugger places you
on. You might want to post that code if you still don't see what's
happening.

Eric

"Fatemeh" <fs*************@yahoo.com> wrote in message
news:f7**************************@posting.google.c om...
Hi
I met problems with C# lately.
I create a new project with C# and press F5 (or press button start)
This program start without error but whenever I insert a button in form
In this program occurred an error and I don't understand why occurred this error!!!! Help me!
This error included four buttons: Break, Continue, Ignore (inactive) and Help that none of buttons don't display correct result,why really?
***********************************text error********************************** " An unhandled exception of type 'System.ArithmeticException'occurred in

system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation." ************************************************** **************************
*** Email: fs*************@yahoo.com
Best regards,
Fatemeh Hashemian


Nov 16 '05 #2

P: n/a
On 13 Jul 2004 23:12, Fatemeh wrote:
Hi
I met problems with C# lately.
I create a new project with C# and press F5 (or press button start)
This program start without error but whenever I insert a button in form
In this program occurred an error and I don't understand why occurred this
error!!!!
Help me!
This error included four buttons: Break, Continue, Ignore (inactive) and Help
that none of buttons don't display correct result,why really?
***********************************text error**********************************
" An unhandled exception of type 'System.ArithmeticException'occurred in

system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation."
************************************************* ******************************
Email: fs*************@yahoo.com
Best regards,
Fatemeh Hashemian

It sounds like this might clear it up for you:

public class Externs {
private Externs() {
}

// used to reset FP register to default state as per
// http://support.microsoft.com/default...en-us%3B326219
// If FPR not in default state initing fonts in controls can fail.
// _CW_DEFAULT should be the first arg, and 0xfffff the second
[DllImport("msvcr70.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int _controlfp(int n, int mask);
// definitions taken from FLOAT.h
public static int _CW_DEFAULT =
0x00000000 + 0x00000000 + 0x00000010 + 0x00000008 + 0x00000004 + 0x00000002
+ 0x00000001 + 0x00080000; //( _RC_NEAR + _PC_53 + _EM_INVALID + _EM_ZERODIVIDE
+ _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT + _EM_DENORMAL)
}

Use it somewhere in your startup before creating the form as so:

Externs._controlfp(Externs._CW_DEFAULT, 0xfffff);
HTH!

--
Simon Smith
simon dot s at ghytred dot com
www.ghytred.com/NewsLook - NNTP Client for Outlook
Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.