nghiaap
asked on
System.ArithmeticException - Overflow or underflow in the arithmetic operation.
hello everybody
now i have a problem for you
here is all what i have done
I install WinXP over Window server 2003 on which IDE 2003 was install (install a fresh WinXP into the same Window folder of Window Server 2003), and reinstall IDE 2003
After successful Installation, I create an new project (VB or C#) but my app threw an System.ArithmeticException exception, the error message: Overflow or underflow in the arithmetic operation
I found in MSDN help an article Q326219 about this problem
It suggest to replace
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
to
[DllImport("msvcr70.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int _controlfp(int n, int mask);
[STAThread]
static void Main()
{
const int _EM_OVERFLOW = 0x00000004;
const int _MCW_EM = 0x0008001F;
_controlfp(_EM_OVERFLOW, _MCW_EM);
Application.Run(new Form1());
}
but the exception still there
I don't know why and how to fix it
please help me
500 points was waiting for you
thanks
now i have a problem for you
here is all what i have done
I install WinXP over Window server 2003 on which IDE 2003 was install (install a fresh WinXP into the same Window folder of Window Server 2003), and reinstall IDE 2003
After successful Installation, I create an new project (VB or C#) but my app threw an System.ArithmeticException
I found in MSDN help an article Q326219 about this problem
It suggest to replace
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
to
[DllImport("msvcr70.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int _controlfp(int n, int mask);
[STAThread]
static void Main()
{
const int _EM_OVERFLOW = 0x00000004;
const int _MCW_EM = 0x0008001F;
_controlfp(_EM_OVERFLOW, _MCW_EM);
Application.Run(new Form1());
}
but the exception still there
I don't know why and how to fix it
please help me
500 points was waiting for you
thanks
Did the error message indicate on what line number or line of code the error occurred?
Try changing const int _EM_OVERFLOW = 0x00000004;
to
const long _EM_OVERFLOW = 0x00000004;
to
const long _EM_OVERFLOW = 0x00000004;
ASKER
if the form has any control
error occured at the line create control
ex: Datagrid1 = new System.Windows.Forms.DataG rid();
if there is only form
error occured ad the line declare the class
class Form1:System.Windows.Forms .Form
but i think that the exception was thrown when the Form was created
This error only the earlier occured, you remove the control an run again.
error occured at the line create control
ex: Datagrid1 = new System.Windows.Forms.DataG
if there is only form
error occured ad the line declare the class
class Form1:System.Windows.Forms
but i think that the exception was thrown when the Form was created
This error only the earlier occured, you remove the control an run again.
ASKER
This error had only came after the earlier occured, you removed the control an ran again.
I don't know if reinstalling VS.NET 2003 would also include the reinstallation of the .NET framework. If not, you may want to try that, as there may be differences in the implementation details of the framework (or the CLR) across different versions of Windows.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi Thogek
I have already read your link, but there still is a problem that
only .NET app has the command to fix FPU can run, another not
how can i fix for all .NET app don't has controlfp(...,...) command
I have already read your link, but there still is a problem that
only .NET app has the command to fix FPU can run, another not
how can i fix for all .NET app don't has controlfp(...,...) command
ASKER
hi all,
my .NET is work well now
i think that it is neccessary to post this command for some one have the same problem
I scanned virus and found that there were lagre number of win32... i don't exactly remember the name
I killed it and my .NET worked well
my .NET is work well now
i think that it is neccessary to post this command for some one have the same problem
I scanned virus and found that there were lagre number of win32... i don't exactly remember the name
I killed it and my .NET worked well