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