We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

'System.ArithmeticException' occurred in system.drawing.dll

Hi, I can't compile my existing VB.NET programs or write new ones because I get this error ervery time: 'System.ArithmeticException' occurred in system.drawing.dll. To duplicate this problem, I create a new VB.NET project with a single form. If the is blank (i.e, has no controls or menus) then it would compile and run, but as soon as I put any control or menu on the form, I would get the above error when i compile or run it. Can anyone help me? Thank you.

17 Replies

AD Administrator Syncfusion Team May 13, 2003 06:57 AM UTC

So this problem is not specific to Syncfusion controls? If its a general problem, you may have to re-install the .NET framework.


CA CatBuiTinhSay May 13, 2003 10:22 AM UTC

> So this problem is not specific to Syncfusion controls? > > If its a general problem, you may have to re-install the .NET framework. I re-installed .NET framework, everything works fine for 2 days, and only 2 days!


UN Unknown Syncfusion Team May 13, 2003 07:38 PM UTC

What's the setup of your computer? - I have exactly the same problem, (and have not been able to find a solution). My PC is a dual proc Xeon 2.2 Regards Jeremy


AD Administrator Syncfusion Team May 13, 2003 10:37 PM UTC

Try doing a Google search for "'System.ArithmeticException' occurred in system.drawing.dll". Seems like other programmers also ran into this issue (see the groups). There is also a KB article: http://support.microsoft.com/support/kb/articles/q326/2/19.asp Q326219 BUG: Exception Error When You Change FPU in Managed Application Not sure if this related ... Maybe one these links help: http://groups.google.com/groups?q=%27System.ArithmeticException%27+occurred+in+system.drawing.dll&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=e86bf36a.0210170550.338b0c0e%40posting.google.com&rnum=1 http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=aZQb510TCHA.2132%40cpmsftngxa08&rnum=11&prev=/groups%3Fq%3D%27System.ArithmeticException%27%2Boccurred%2Bin%2Bsystem.drawing.dll%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26start%3D10%26sa%3DN Other than this, no idea what could cause this. Stefan


UN Unknown Syncfusion Team May 14, 2003 07:13 PM UTC

Stefan Any chance of translating the code on the Microsoft KB to VB? I experience this problem with all controls - in my own application where I'm using the native Msoft controls, I can trap for the error and just ignore it. You had this problem in version 1.5.2 - in 1.6.2 the GridDataBoundGrid now traps the error - however most of the other controls do not. I've created a number of DirectTrac reports relating to this, but to no effect. The simplest solution is to trap anything that initializes a system.font - I would prefer the control not functioning rather than crashing the application. Regards Jeremy


UN Unknown Syncfusion Team May 14, 2003 07:15 PM UTC

Sorry - ignore the last message - I just followed your first link and saw the code Jeremy


UN Unknown Syncfusion Team May 14, 2003 07:28 PM UTC

I tried the code but it makes no difference at all!!. Putting a CurrencyEditBox on a form produces the following error when trying to type from the keyboard into the calculator syncfusion.tools.dll!Engine.HandleAction(Syncfusion.Windows.Forms.Tools.CalcActions action = CalcDigit5) + 0xbf bytes syncfusion.tools.dll!Syncfusion.Windows.Forms.Tools.CalculatorControl.ButtonAction(Syncfusion.Windows.Forms.Tools.CalcActions action = CalcDigit5) + 0x27 bytes syncfusion.tools.dll!Syncfusion.Windows.Forms.Tools.CalculatorButton.OnClick(System.EventArgs e = {System.EventArgs}) + 0x38 bytes system.windows.forms.dll!System.Windows.Forms.Button.OnMouseUp(System.Windows.Forms.MouseEventArgs mevent = {X=0 Y=0 Button=Left}) + 0x133 bytes syncfusion.tools.dll!Syncfusion.Windows.Forms.Tools.XPButton.OnMouseUp(System.Windows.Forms.MouseEventArgs e = {X=0 Y=0 Button=Left}) + 0x17 bytes system.windows.forms.dll!System.Windows.Forms.Control.WmMouseUp(System.Windows.Forms.Message m = {System.Windows.Forms.Message}, System.Windows.Forms.MouseButtons button = Left, int clicks = 1) + 0x261 bytes system.windows.forms.dll!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x49b bytes system.windows.forms.dll!System.Windows.Forms.ButtonBase.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x121 bytes system.windows.forms.dll!System.Windows.Forms.Button.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x85 bytes syncfusion.tools.dll!Syncfusion.Windows.Forms.Tools.XPButton.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x36 bytes system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int hWnd = 919374, int msg = 514, int wparam = 0, int lparam = 0) + 0x3d bytes syncfusion.tools.dll!Syncfusion.Windows.Forms.Tools.CalculatorControl.SimulateButtonClick(int buttonIndex = 9) + 0xf0 bytes syncfusion.tools.dll!Syncfusion.Windows.Forms.Tools.CalculatorControl.HandleChildKeyDown(System.Windows.Forms.KeyEventArgs e = {KeyData=NumPad5}) + 0xa2 bytes syncfusion.tools.dll!Syncfusion.Windows.Forms.Tools.CalculatorButton.OnKeyDown(System.Windows.Forms.KeyEventArgs e = {KeyData=NumPad5}) + 0x35 bytes system.windows.forms.dll!System.Windows.Forms.Control.ProcessKeyEventArgs(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x387 bytes system.windows.forms.dll!System.Windows.Forms.Control.ProcessKeyMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x36 bytes system.windows.forms.dll!System.Windows.Forms.Control.WmKeyChar(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes system.windows.forms.dll!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x3ae bytes system.windows.forms.dll!System.Windows.Forms.ButtonBase.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x15b bytes system.windows.forms.dll!System.Windows.Forms.Button.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x85 bytes syncfusion.tools.dll!Syncfusion.Windows.Forms.Tools.XPButton.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x36 bytes system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(int hWnd = 853832, int msg = 256, int wparam = 101, int lparam = 4980737) + 0x3d bytes system.windows.forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(int dwComponentID = 1, int reason = -1, int pvLoopData = 0) + 0x349 bytes system.windows.forms.dll!ThreadContext.RunMessageLoopInner(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x1f3 bytes system.windows.forms.dll!ThreadContext.RunMessageLoop(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x50 bytes system.windows.forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm = {AmberwoodFrontEnd.Form2}) + 0x34 bytes > AmberwoodFrontEnd.exe!AmberwoodFrontEnd.Form2.Main() Line 2 + 0x1d bytes Basic Jeremy


UN Unknown Syncfusion Team May 14, 2003 07:30 PM UTC

'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded. 'AmberwoodFrontEnd': Loaded 'G:\Visual Studio Projects\AmberwoodDataBase\AmberwoodFrontEnd\bin\AmberwoodFrontEnd.exe', Symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'g:\visual studio projects\amberwooddatabase\amberwoodfrontend\bin\amberwoodshared.dll', Symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\syncfusion.tools\1.6.0.1__3d67ed1f87d44c89\syncfusion.tools.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\syncfusion.shared\1.6.0.1__3d67ed1f87d44c89\syncfusion.shared.dll', No symbols loaded. An unhandled exception of type 'System.ArithmeticException' occurred in syncfusion.tools.dll Additional information: Overflow or underflow in the arithmetic operation.


AD Administrator Syncfusion Team May 14, 2003 09:09 PM UTC

Did you ever try reinstalling the whole system? Or try installing a 2nd os on the same system, just the bare OS and then the .NET Framework. And then see if the problem happens after you install a specific application. But I will also make sure we'll add try/exception pairs whenever we allocate fonts (maybe a global utility fn that does that). But you might still get errors with the .NET controls themselves, e.g. LinkLabel also does not allocate fonts with try/catch. I looked through our database. We had once a customer report a similar problem with allocating font and he said it was because of a faulty ODBC driver he had, some kind of buffer overrun. Stefan


UN Unknown Syncfusion Team May 14, 2003 11:39 PM UTC

Stefan I've had VS Studio installed on two machines both dual proc - one d/p Xeon and one d/p P3 400, under Win 2000 as well as XP Professional. I've never installed it on a single proc machine. In each case I've had the same problem. I had some correspondence with someone from Microsoft on their newsgroup, who gave completely incomprehencible instructions to get around the problem. Essentially he gave the same info as the chap on the link you provided above. Further he suggested that at some point I was initializing some kind of access to printing under NET which I wasn't (and still not), implying that this was the probable cause of the problem. I've looked at the BIOS on my machine to see if there is some way to turn of FPU operations, but to be honest I don't know what I'm looking for. I attach a list of running procs on my machine (none of which seem to be particularly likely to cause this problem). On a side note, I occasionaly have a situation where Windows goes completely bananas - all the text in all the windows (Word, Excel, Explorer etc) start moving up and down at at a frantic rate. This used to happen with VB 6.0 on Win 2000 as well, and only happens when VS Studio is running - this might happen once a month - rebooting solves this problem. Not sure if this is related in any way. The arithmetic error problem is also not consistent. Sometimes its really bad, sometimes I don't get it at all. I really can't pin down under what circumstances its particularly bad. However, its interesting to note that your controls without the try/catch will fail 100% of the time, while the native LinkLabel might fail 15% of the time. Anyway, thanks for taking the time out to try helping me with this problem. I'd also like to take this opportunity to say your suite (minor problems aside) is absolutely marvellous. I have succeeded in completely updating one major application, and am in the process of updating a second to take advantage of your controls. I have other suites (Infragistics and Developer Express) but have never managed to get to grips with them - your is by far and away the most useful and customizable suite I've come across, and the support here is exceptional. Assuming that you manage to fix the arithmetic exception problem, would you consider creating two other controls???? 1. A checkbox control that has a transparent background for the text with XP Themes enabled (the Miscrosoft version looks horrid on your gradient panel) 2. A way of getting the XPComboBarItem to work properly with an external datasource, and the combo to work like the DataGridComboBox?? Best regards Jeremy Holt Amberwood Trading Ltd Fortaleze, CE, Brazil Program PID Path Manufacturer Modules alg.exe 1620 C:\WINDOWS\System32\ Microsoft Corporation 38 CCAPP.EXE 1292 C:\Program Files\Common Files\Symantec Shared\ Symantec Corporation 83 CCEVTMGR.EXE 1172 C:\Program Files\Common Files\Symantec Shared\ Symantec Corporation 49 CCPXYSVC.EXE 1632 C:\Program Files\Norton Personal Firewall\ Symantec Corporation 59 cidaemon.exe 2208 C:\WINDOWS\System32\ Microsoft Corporation 28 cidaemon.exe 2272 C:\WINDOWS\System32\ Microsoft Corporation 22 cisvc.exe 1648 C:\WINDOWS\System32\ Microsoft Corporation 23 csrss.exe 476 C:\WINDOWS\system32\ Microsoft Corporation 10 ctfmon.exe 2512 C:\WINDOWS\System32\ Microsoft Corporation 12 CTITrayI.exe 3564 C:\Program Files\WinFax\ Concord Technologies, Inc. 15 devenv.exe 2424 C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\ Microsoft Corporation 263 devldr32.exe 3436 C:\WINDOWS\System32\ Creative Technology Ltd. 23 Ent.exe 3872 C:\Program Files\EssNetTools3\ TamoSoft, Inc. 42 EXCEL.EXE 2868 C:\Program Files\Microsoft Office\OFFICE11\ 72 explorer.exe 4092 C:\WINDOWS\ Microsoft Corporation 102 hpgs2wnd.exe 4052 C:\Program Files\Hewlett-Packard\HP Share-to-Web\ Hewlett-Packard 21 hpgs2wnf.exe 2464 C:\Program Files\Hewlett-Packard\HP Share-to-Web\ 21 hpoevm07.exe 4040 C:\Program Files\Hewlett-Packard\AiO\Shared\Bin\ Hewlett-Packard Co. 23 hpofxm07.exe 1208 C:\Program Files\Hewlett-Packard\AiO\Shared\bin\ Hewlett-Packard Co. 37 hpoipm07.exe 1852 C:\WINDOWS\System32\ HP 13 hpoojd07.exe 2628 C:\Program Files\Hewlett-Packard\AiO\hp officejet d series\Bin\ Hewlett-Packard Co. 40 hposts07.exe 2748 C:\Program Files\Hewlett-Packard\AiO\Shared\bin\ Hewlett-Packard Co. 36 iexplore.exe 2928 C:\Program Files\Internet Explorer\ Microsoft Corporation 91 iexplore.exe 408 C:\Program Files\Internet Explorer\ Microsoft Corporation 90 inetinfo.exe 1700 C:\WINDOWS\System32\inetsrv\ Microsoft Corporation 81 lsass.exe 556 C:\WINDOWS\system32\ Microsoft Corporation 49 mdm.exe 1728 C:\Program Files\Common Files\Microsoft Shared\VS7Debug\ Microsoft Corporation 22 msmsgs.exe 1816 C:\Program Files\Messenger\ Microsoft Corporation 73 NAVAPSVC.EXE 1312 C:\Program Files\Norton AntiVirus\ Symantec Corporation 17 NISUM.EXE 1196 C:\Program Files\Norton Personal Firewall\ Symantec Corporation 38 nvsvc32.exe 1332 C:\WINDOWS\System32\ NVIDIA Corporation 11 ONQNOTE.EXE 2672 C:\Program Files\Microsoft Office\OFFICE11\ 14 OUTLOOK.EXE 1640 C:\Program Files\Microsoft Office\OFFICE11\ 109 scardsvr.exe 1428 C:\WINDOWS\System32\ Microsoft Corporation 7 services.exe 544 C:\WINDOWS\system32\ Microsoft Corporation 22 smss.exe 424 C:\WINDOWS\System32\ Microsoft Corporation 1 SnagIt32.exe 2696 C:\Program Files\TechSmith\SnagIt 6\ TechSmith Corporation 28 spoolsv.exe 1140 C:\WINDOWS\system32\ Microsoft Corporation 53 sqlagent.exe 1324 C:\Program Files\Microsoft SQL Server\MSSQL\Binn\ Microsoft Corporation 58 sqlmangr.exe 536 C:\Program Files\Microsoft SQL Server\80\Tools\Binn\ Microsoft Corporation 39 sqlservr.exe 1764 C:\Program Files\Microsoft SQL Server\MSSQL$NETSDK\Binn\ Microsoft Corporation 31 sqlservr.exe 2020 C:\Program Files\Microsoft SQL Server\MSSQL\Binn\ Microsoft Corporation 63 svchost.exe 748 C:\WINDOWS\system32\ Microsoft Corporation 28 svchost.exe 836 C:\WINDOWS\System32\ Microsoft Corporation 175 svchost.exe 948 C:\WINDOWS\System32\ Microsoft Corporation 25 svchost.exe 976 C:\WINDOWS\System32\ Microsoft Corporation 48 svchost.exe 1544 C:\WINDOWS\System32\ Microsoft Corporation 23 System 4 0 System Idle 0 0 taskmgr.exe 1812 C:\WINDOWS\System32\ Microsoft Corporation 28 TaskSwitch.exe 2384 C:\WINDOWS\System32\ 13 type32.exe 1020 C:\Program Files\Microsoft Hardware\Keyboard\ 25 wcescomm.exe 2492 C:\Program Files\Microsoft ActiveSync\ Microsoft Corporation 29 WFXCTL32.EXE 480 C:\Program Files\WinFax\ 79 WFXSNT40.EXE 2376 C:\WINDOWS\System32\ Microsoft Corporation 10 WFXSWTCH.exe 1656 C:\Program Files\WinFax\ 11 winlogon.exe 500 C:\WINDOWS\system32\ Microsoft Corporation 84 WINWORD.EXE 2920 C:\Program Files\Microsoft Office\OFFICE11\ 74 WZQKPICK.EXE 3516 C:\Program Files\WinZip\ WinZip Computing, Inc. 15


AD Administrator Syncfusion Team May 16, 2003 11:17 AM UTC

Jeremy, we'll have wrapped all new Font calls with try/catch calls and that should be in the next time we build. I'll forward your feature requests to the tools team. Here is one more suggestion. Can you try the following code instead of the code suggested in the MSKB article: [C#] [DllImport("msvcr70.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int _controlfp(int n, int mask); private void Form1_Load(object sender, System.EventArgs e) { const int _RC_NEAR = 0; const int _PC_53 = 0x00010000; const int _EM_INVALID = 0x00000010; const int _EM_ZERODIVIDE = 0x00000008; const int _EM_OVERFLOW = 0x00000004; const int _EM_UNDERFLOW = 0x00000002; const int _EM_INEXACT = 0x00000001; const int _EM_DENORMAL = 0x00080000; const int _CW_DEFAULT = _RC_NEAR + _PC_53 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT + _EM_DENORMAL; _controlfp(_CW_DEFAULT, 0xfffff);; } [VB] _ Public Shared Function _controlfp(n As Integer, mask As Integer) As Integer Private Sub Form1_Load(sender As Object, e As System.EventArgs) Const _RC_NEAR As Integer = 0 Const _PC_53 As Integer = &H10000 Const _EM_INVALID As Integer = &H10 Const _EM_ZERODIVIDE As Integer = &H8 Const _EM_OVERFLOW As Integer = &H4 Const _EM_UNDERFLOW As Integer = &H2 Const _EM_INEXACT As Integer = &H1 Const _EM_DENORMAL As Integer = &H80000 Const _CW_DEFAULT As Integer = _RC_NEAR + _PC_53 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT + _EM_DENORMAL _controlfp(_CW_DEFAULT, &HFFFFF) End Sub 'Form1_Load Stefan


AD Administrator Syncfusion Team May 16, 2003 11:18 AM UTC

_ Public Shared Function _controlfp(n As Integer, mask As Integer) As Integer


UN Unknown Syncfusion Team May 16, 2003 01:57 PM UTC

Stefan I tried putting the code before and after InitializeComponenets and in Form_Load. On a form with a single currency edit - it still crashews with the following stack trace when typing into the calculator from the keyboard. 'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded. 'AmberwoodFrontEnd': Loaded 'G:\Visual Studio Projects\AmberwoodDataBase\AmberwoodFrontEnd\bin\AmberwoodFrontEnd.exe', Symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\syncfusion.tools\1.6.0.1__3d67ed1f87d44c89\syncfusion.tools.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\syncfusion.shared\1.6.0.1__3d67ed1f87d44c89\syncfusion.shared.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'g:\visual studio projects\amberwooddatabase\amberwoodfrontend\bin\amberwoodshared.dll', No symbols loaded. An unhandled exception of type 'System.ArithmeticException' occurred in syncfusion.tools.dll Additional information: Overflow or underflow in the arithmetic operation. Unhandled Exception: System.ArithmeticException: Overflow or underflow in the arithmetic operation. at Syncfusion.Windows.Forms.Tools.Engine.HandleAction(CalcActions action) at Syncfusion.Windows.Forms.Tools.CalculatorControl.ButtonAction(CalcActions action) at Syncfusion.Windows.Forms.Tools.CalculatorButton.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at Syncfusion.Windows.Forms.Tools.XPButton.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at Syncfusion.Windows.Forms.Tools.XPButton.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at Syncfusion.Runtime.InteropServices.NativeMethods.SendMessage(IntPtr hWnd, Int32 msg, Int32 wParam, Int32 lParam) at Syncfusion.Windows.Forms.Tools.CalculatorControl.SimulateButtonClick(Int32 buttonIndex) at Syncfusion.Windows.Forms.Tools.CalculatorControl.HandleChildKeyDown(KeyEventArgs e) at Syncfusion.Windows.Forms.Tools.CalculatorButton.OnKeyDown(KeyEventArgs e) at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m) at System.Windows.Forms.Control.ProcessKeyMessage(Message& m) at System.Windows.Forms.Control.WmKeyChar(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at Syncfusion.Windows.Forms.Tools.XPButton.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at AmberwoodFrontEnd.Form2.Main() in G:\Visual Studio Projects\AmberwoodDataBase\AmberwoodFrontEnd\Form2.vb:line 1The program '[1112] AmberwoodFrontEnd.exe' has exited with code 0 (0x0). Regards Jeremy


UN Unknown Syncfusion Team May 16, 2003 02:01 PM UTC

Stefan It just occurred to me - how can I tell what the value of the FPC Register is? Then at least I'll know if _controlfp is setting it correctly Thanks Jeremy


AD Administrator Syncfusion Team May 16, 2003 02:12 PM UTC

Try adding Main method and put the code there. Then in your project settings, set the StartUp to this Main...
  _
    Public Shared Sub Main()

        ' insert the code here.....

        Application.Run(New Form1())
    End Sub 'Main


AD Administrator Syncfusion Team May 16, 2003 02:13 PM UTC

You can find these methods in C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\float.h My guess is _statusfp. Too bad that didn't help either. I am out of ideas. But we'll wrap the "new Font" calls. Stefan


UN Unknown Syncfusion Team May 16, 2003 03:11 PM UTC

Stefan Sorry this makes no difference putting it in sub main. Assuming I declared statusfp correctly? _ Public Function _statusfp() As Integer End Function The result before and after running controlfp is 0 Now .... Setting n in controlfp to anything other than &H9001F causes the following stack trace as the form is loading on a form with a CurrencyEdit control 'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded. 'AmberwoodFrontEnd': Loaded 'G:\Visual Studio Projects\AmberwoodDataBase\AmberwoodFrontEnd\bin\AmberwoodFrontEnd.exe', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'g:\visual studio projects\amberwooddatabase\amberwoodfrontend\bin\amberwoodshared.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\microsoft.visualbasic\7.0.5000.0__b03f5f7f11d50a3a\microsoft.visualbasic.dll', No symbols loaded. **** Before reset 0 **** After reset 0 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\syncfusion.tools\1.6.0.1__3d67ed1f87d44c89\syncfusion.tools.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\syncfusion.shared\1.6.0.1__3d67ed1f87d44c89\syncfusion.shared.dll', No symbols loaded. An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll Additional information: Overflow or underflow in the arithmetic operation. Unhandled Exception: System.ArithmeticException: Overflow or underflow in the arithmetic operation. at System.Drawing.Font.get_SizeInPoints() at System.Windows.Forms.ControlPaint.FontInPoints(Font font) at System.Windows.Forms.Control.get_DefaultFont() at System.Windows.Forms.Control.get_Font() at System.Windows.Forms.Control.get_FontHeight() at System.Windows.Forms.TextBoxBase.get_PreferredHeight() at System.Windows.Forms.TextBoxBase.get_DefaultSize() at System.Windows.Forms.Control..ctor() at System.Windows.Forms.TextBoxBase..ctor() at System.Windows.Forms.TextBox..ctor() at Syncfusion.Windows.Forms.Tools.NumberTextBoxBase..ctor() at Syncfusion.Windows.Forms.Tools.CurrencyTextBox..ctor() at Syncfusion.Windows.Forms.Tools.CurrencyEdit.CreateTextBox() at Syncfusion.Windows.Forms.Tools.ButtonEdit..ctor() at Syncfusion.Windows.Forms.Tools.CurrencyEdit..ctor() at AmberwoodFrontEnd.Form2.InitializeComponent() at AmberwoodFrontEnd.Form2..ctor() at AmberwoodFrontEnd.Form2.Main()The program '[1944] AmberwoodFrontEnd.exe' has exited with code 0 (0x0). On a completely empty form you get this stacktrace 'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded. 'AmberwoodFrontEnd': Loaded 'G:\Visual Studio Projects\AmberwoodDataBase\AmberwoodFrontEnd\bin\AmberwoodFrontEnd.exe', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'g:\visual studio projects\amberwooddatabase\amberwoodfrontend\bin\amberwoodshared.dll', No symbols loaded. 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\microsoft.visualbasic\7.0.5000.0__b03f5f7f11d50a3a\microsoft.visualbasic.dll', No symbols loaded. **** Before reset 0 **** After reset 0 'AmberwoodFrontEnd.exe': Loaded 'c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded. An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll Additional information: Overflow or underflow in the arithmetic operation. Unhandled Exception: System.ArithmeticException: Overflow or underflow in the arithmetic operation. at System.Drawing.Font.get_SizeInPoints() at System.Windows.Forms.ControlPaint.FontInPoints(Font font) at System.Windows.Forms.Control.get_DefaultFont() at System.Windows.Forms.Control.get_Font() at System.Windows.Forms.Form.ApplyAutoScaling() at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow) at System.Windows.Forms.Control.SetVisibleCore(Boolean value) at System.Windows.Forms.Form.SetVisibleCore(Boolean value) at System.Windows.Forms.Control.set_Visible(Boolean value) at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at AmberwoodFrontEnd.Form2.Main()The program '[2644] AmberwoodFrontEnd.exe' has exited with code 0 (0x0). Would this not imply that _controlfp is indeed influencing the ability of .NET to initialize its fonts? I suppose the question is - what is the correct value for n?? Jeremy

Loader.
Up arrow icon