help!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fatemeh

    help!

    Hi
    I met problems with C# lately.
    I create a new project with C# and press F5 (or press button start)
    This program start without error but whenever I insert a button in form
    In this program occurred an error and I don't understand why occurred this error!!!!
    Help me!
    This error included four buttons: Break, Continue, Ignore (inactive) and Help
    that none of buttons don't display correct result,why really?
    *************** *************** *****text error********** *************** *********
    " An unhandled exception of type 'System.Arithme ticException'oc curred in

    system.drawing. dll
    Additional information: Overflow or underflow in the arithmetic operation."
    *************** *************** *************** *************** *************** ****
    Email: fshashemian1362 @yahoo.com
    Best regards,
    Fatemeh Hashemian
  • Eric Johannsen

    #2
    Re: help!

    Select the button "Break" and see what line of code the debugger places you
    on. You might want to post that code if you still don't see what's
    happening.

    Eric

    "Fatemeh" <fshashemian136 2@yahoo.com> wrote in message
    news:f7a4de64.0 407131412.577eb 002@posting.goo gle.com...[color=blue]
    > Hi
    > I met problems with C# lately.
    > I create a new project with C# and press F5 (or press button start)
    > This program start without error but whenever I insert a button in form
    > In this program occurred an error and I don't understand why occurred this[/color]
    error!!!![color=blue]
    > Help me!
    > This error included four buttons: Break, Continue, Ignore (inactive) and[/color]
    Help[color=blue]
    > that none of buttons don't display correct result,why really?
    > *************** *************** *****text[/color]
    error********** *************** *********[color=blue]
    > " An unhandled exception of type 'System.Arithme ticException'oc curred in
    >
    > system.drawing. dll
    > Additional information: Overflow or underflow in the arithmetic[/color]
    operation."[color=blue]
    >[/color]
    *************** *************** *************** *************** *************** *
    ***[color=blue]
    > Email: fshashemian1362 @yahoo.com
    > Best regards,
    > Fatemeh Hashemian[/color]

    Comment

    • Simon Smith

      #3
      Re: help!

      On 13 Jul 2004 23:12, Fatemeh wrote:[color=blue]
      >Hi
      >I met problems with C# lately.
      >I create a new project with C# and press F5 (or press button start)
      >This program start without error but whenever I insert a button in form
      >In this program occurred an error and I don't understand why occurred this
      >error!!!!
      >Help me!
      >This error included four buttons: Break, Continue, Ignore (inactive) and Help
      >that none of buttons don't display correct result,why really?
      >************** *************** ******text error********** *************** *********
      >" An unhandled exception of type 'System.Arithme ticException'oc curred in
      >
      >system.drawing .dll
      >Additional information: Overflow or underflow in the arithmetic operation."
      >************** *************** *************** *************** *************** *****
      >Email: fshashemian1362 @yahoo.com
      >Best regards,
      >Fatemeh Hashemian
      >[/color]


      It sounds like this might clear it up for you:

      public class Externs {
      private Externs() {
      }

      // used to reset FP register to default state as per
      // http://support.microsoft.com/default...en-us%3B326219
      // If FPR not in default state initing fonts in controls can fail.
      // _CW_DEFAULT should be the first arg, and 0xfffff the second
      [DllImport("msvc r70.dll", CallingConventi on = CallingConventi on.Cdecl)]
      public static extern int _controlfp(int n, int mask);
      // definitions taken from FLOAT.h
      public static int _CW_DEFAULT =
      0x00000000 + 0x00000000 + 0x00000010 + 0x00000008 + 0x00000004 + 0x00000002
      + 0x00000001 + 0x00080000; //( _RC_NEAR + _PC_53 + _EM_INVALID + _EM_ZERODIVIDE
      + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT + _EM_DENORMAL)
      }

      Use it somewhere in your startup before creating the form as so:

      Externs._contro lfp(Externs._CW _DEFAULT, 0xfffff);


      HTH!

      --
      Simon Smith
      simon dot s at ghytred dot com
      www.ghytred.com/NewsLook - NNTP Client for Outlook


      Comment

      Working...