473,586 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

system Arithmetic Exception Error.

Hi, I have a pc with windows XP SP1, net Framworks 1.1 and visual studio net 2003

When I first installed Visual Studio 2003, I noticed I was getting th
follow error when showing a form

A first chance exception of type 'System.Arithme ticException' occurred i
system.drawing. dl
Additional information: Overflow or underflow in the arithmetic operatio

It is being thrown on the line that attempts to add the controls to th
form's controls collection (in the windows forms designer generated cod
region)

email mf*@tham.cl
Nov 20 '05 #1
3 1712
* "=?Utf-8?B?bWZjMjAwNA= =?=" <an*******@disc ussions.microso ft.com> scripsit:
Hi, I have a pc with windows XP SP1, net Framworks 1.1 and visual studio net 2003.
When I first installed Visual Studio 2003, I noticed I was getting the
follow error when showing a form:

A first chance exception of type 'System.Arithme ticException' 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).


Can you post the form's complete code?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Hi

I've been getting the very same error on the very same operating system configuration, so here's my code. This was generated by adding a windows form with all default properties (including the name even) and then adding a label control with all default properties. If I run the form WITHOUT a control, it works. But as soon as I add ANY control, it gets a System.Arithmet icException error in System.Drawing. I've marked the line of code where it errors out with an asterisk

Public Class Form
Inherits System.Windows. Forms.For

#Region " Windows Form Designer generated code

Public Sub New(
MyBase.New(

'This call is required by the Windows Form Designer
InitializeCompo nent(

'Add any initialization after the InitializeCompo nent() cal

End Su

'Form overrides dispose to clean up the component list
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean
If disposing The
If Not (components Is Nothing) The
components.Disp ose(
End I
End I
MyBase.Dispose( disposing
End Su

'Required by the Windows Form Designe
Private components As System.Componen tModel.IContain e

'NOTE: The following procedure is required by the Windows Form Designe
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor
Friend WithEvents Label1 As System.Windows. Forms.Labe
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub InitializeCompo nent(
Me.Label1 = New System.Windows. Forms.Labe
Me.SuspendLayou t(

'Label

Me.Label1.Locat ion = New System.Drawing. Point(0, 0
Me.Label1.Name = "Label1
Me.Label1.TabIn dex =
Me.Label1.Text = "Label1

'Form

Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13
Me.ClientSize = New System.Drawing. Size(292, 266
* Me.Controls.Add (Me.Label1
Me.Name = "Form1
Me.Text = "Form1
Me.ResumeLayout (False

End Su

#End Regio

End Clas

Nov 20 '05 #3
Hi Eric

In a new project or in an existing project?

Cor
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
30277
by: Gary.Hu | last post by:
I was trying to catch the Arithmetic exception, unsuccessfully. try{ int a = 0, b = 9; b = b / a; }catch(...){ cout << "arithmetic exception was catched!" << endl; } After ran the program, it quitted with core dumped. %test
0
277
by: Fiona McBride | last post by:
Hi all, I have a really odd problem with some Visual Basic .NET 2003 code; I have a program that creates a number of windows which contain RichTextBox, Timers (disabled) and menus. The code runs fine and creates the windows as required, BUT if the program is left to do nothing for several hours, when it is brought back into focus it...
4
1272
by: tarmat | last post by:
I have a class that has a std::list of ints as a member. Let's say its this: std::list<int> MyInts; Frequently, another list of ints is assigned to MyInts MyInts = MyOtherInts; This occasionally gives me a "First-chance exception" error. I haven't
4
25240
by: Saso Zagoranski | last post by:
Hi! I have created an SqlCommand object and I have set some parameters to it... One of the parameters is of the DateTime type; here is the code: sqlCommand.Parameters.Value = DateTime.Parse(this.DateTextBox.Text); sqlCommand.ExecuteNonReader(); I get the error:
9
2094
by: Ron | last post by:
my application is throwing an exception error when closing if I run a procedure in the app. I can't even trap the error with try/catch ex As Exception. Is there a way to completely shut down the app through code? I am using End for now. Is there a way I can suppress this exception message? The app gets invoked programmatically on a...
0
257
by: Matt | last post by:
Hello, I am trying to make an asp.net page and I keep getting the following error in my web browser: Error: External component has thrown an exception. Stack: at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound) at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath() at
2
2265
by: shivp | last post by:
Hi, I'm getting folowing exception error while compiling the code in VS2005. $exception {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.} System.Exception {System.Threading.ThreadAbortException} How to overcome this error. Please send the ASAP Thanks in Advance.
4
2069
by: yogarajan | last post by:
hi i had developed pop3 Account mail view in my web page but i got error in (System.NullReference Exception: Object reference not set) NetStrm.Write(szData, 0, szData.Length); - this line ///my code start here (cs file) using System; using System.Data;
3
6917
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or write protected memory. this is often an indication that other memory is corrupt.... " These are all the platform info : Visual Studio 2005...
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7841
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8204
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7965
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3838
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.