C
Codemonkey
Hi,
When I first installed Visual Studio 2003, I noticed I was getting the
following error when showing a form:
A first chance exception of type 'System.ArithmeticException' occurred in
system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation
It is being thrown on the line that attempts to add the controls to the
form's controls collection (in the windows forms designer generated code
region).
Looking at the call stack, the error is occuring on the following method
call:
System.Drawing.Font.Initialize({Name="Microsoft Sans Serif"}, 8.25, Regular,
Point, 0, false)
System.Drawing.Font.Font({Name="Microsoft Sans Serif"}, 8.25, Regular,
Point, 0, false)
System.Windows.Forms.ControlPaint.FontInPoints({Name="Microsoft Sans Serif"
Size=11.0})
System.Windows.Forms.Control.get_DefaultFont()
System.Windows.Forms.Control.get_Font()
System.Windows.Forms.Control.AssignParent({AMS.UI.Controls.ctlPlantExplorer}
)
System.Windows.Forms.Control.ControlCollection.Add({System.Windows.Forms.Tre
eView})
I've searched the web for fixes for this and found out that it has something
to do with the FPU. I also found the following workaround:
----------------------
'*************************************************
' FixFPU: Fixes a bug in .net that causes Windows
' forms to mess up if the FPU not set up
'*************************************************
<System.Runtime.InteropServices.DllImport("msvcrt.dll")> _
Private Function _controlfp(ByVal IN_New As Integer, ByVal IN_Mask As
Integer) As Integer
End Function
Private Const _MCW_EW As Integer = &H8001F
Private Const _EM_INVALID As Integer = &H10
Private Sub FixFPU()
_controlfp(_MCW_EW, _EM_INVALID)
End Sub
----------------------
This is all well and good in my own application that I have the source code
for, but the bug seems to affect all .Net applications (C# ones too). If I
install a .net program and try and run it, the program crashes with the same
error.
This problem did go away for a long time on my machine, but it's back now
with a vengance. I haven't installed any major programs or changed the .net
configuration that might have caused this.
I'm using Visual Studio .net 2003 and .Net Framework 1.1. My CPU is an AMD
Athlon. I never had this problem when using the .net Framwork 1.0.
Any help would be appreciated. It's basically crippled my machine as I can't
run any .net apps.
Best Regards,
Trev.
When I first installed Visual Studio 2003, I noticed I was getting the
following error when showing a form:
A first chance exception of type 'System.ArithmeticException' occurred in
system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation
It is being thrown on the line that attempts to add the controls to the
form's controls collection (in the windows forms designer generated code
region).
Looking at the call stack, the error is occuring on the following method
call:
System.Drawing.Font.Initialize({Name="Microsoft Sans Serif"}, 8.25, Regular,
Point, 0, false)
System.Drawing.Font.Font({Name="Microsoft Sans Serif"}, 8.25, Regular,
Point, 0, false)
System.Windows.Forms.ControlPaint.FontInPoints({Name="Microsoft Sans Serif"
Size=11.0})
System.Windows.Forms.Control.get_DefaultFont()
System.Windows.Forms.Control.get_Font()
System.Windows.Forms.Control.AssignParent({AMS.UI.Controls.ctlPlantExplorer}
)
System.Windows.Forms.Control.ControlCollection.Add({System.Windows.Forms.Tre
eView})
I've searched the web for fixes for this and found out that it has something
to do with the FPU. I also found the following workaround:
----------------------
'*************************************************
' FixFPU: Fixes a bug in .net that causes Windows
' forms to mess up if the FPU not set up
'*************************************************
<System.Runtime.InteropServices.DllImport("msvcrt.dll")> _
Private Function _controlfp(ByVal IN_New As Integer, ByVal IN_Mask As
Integer) As Integer
End Function
Private Const _MCW_EW As Integer = &H8001F
Private Const _EM_INVALID As Integer = &H10
Private Sub FixFPU()
_controlfp(_MCW_EW, _EM_INVALID)
End Sub
----------------------
This is all well and good in my own application that I have the source code
for, but the bug seems to affect all .Net applications (C# ones too). If I
install a .net program and try and run it, the program crashes with the same
error.
This problem did go away for a long time on my machine, but it's back now
with a vengance. I haven't installed any major programs or changed the .net
configuration that might have caused this.
I'm using Visual Studio .net 2003 and .Net Framework 1.1. My CPU is an AMD
Athlon. I never had this problem when using the .net Framwork 1.0.
Any help would be appreciated. It's basically crippled my machine as I can't
run any .net apps.
Best Regards,
Trev.