Overflow Error in C# - why?

chuawenching

Regular
Joined
Jul 26, 2003
Messages
66
Okay i had 1 question..

my program runs smoothly for the first minute, after 1 minute...

suddenly it breaks and display this error:

do you know what is the cause of this problem...

i had check my codes and confirm it is working.. shouldn't be a problem on logic side

An unhandled exception of type 'System.OverflowException' occurred in system.windows.forms.dll
Additional information: Overflow error.

Any help? What is the possible cause for a program to see this error?

Regards,
Chua Wen Ching :p
 
One explanation is that you are trying to assign a value to a variable (usually numeric) that is out of the range for the data type. For example, a System.Int16 var has a max value of 32,767. If you go beyond this value, you'll have an OverFlowException.
 
Oh... i see.

Okay, actualy i was learning something. A existing c# code which i download from google. It works fine and no problem.

When i re-code everything from scratch, got problem with overflow?

Any idea? I also check for project properties and all of them are similar.

Regards,
Chua Wen Ching :p
 
It is working fine...

when i break it, it returns back to:

static void main()
{
Application.Run(new SwarmNormal());
} // it is highligheted in green

Regards,
Chua Wen Ching :p
 
Back
Top