Odd Exception Trying To Load Form

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

    Odd Exception Trying To Load Form

    I am back yet again :)

    I am encountering an Exception that has me scratching my
    head. I have two forms. Form A launches Form B in response
    to the user clicking a button. The Constructor for Form B
    takes 5 parameters but none of them complicated ( three
    short strings and two booleans ). Form B does have several
    controls on it (around 148 when you count in group boxes,
    labes and menus). However, I have forms with far more that
    load without a problem.

    The constructor simply sets 5 class values and of corse
    the required InitializeCompo nent() call is there.
    Everytime I attempt to load Form B I get the following
    Exception

    System.StackOve rflowException: Exception of type
    System.StackOve rflowException was thrown

    I can't figure out what the problem may be. If anyone has
    any ideas I would greatly appreciate it. Thanks!

    Dan
  • Michael Culley

    #2
    Re: Odd Exception Trying To Load Form

    "Dan" <ddeluca@fnisol utions.com> wrote in message news:08c101c3a9 8e$03dd22a0$a10 1280a@phx.gbl.. .[color=blue]
    > Everytime I attempt to load Form B I get the following
    > Exception
    >
    > System.StackOve rflowException: Exception of type
    > System.StackOve rflowException was thrown[/color]

    Check the call stack, most likely a function is calling itself repeatedly.

    --
    Michael Culley


    Comment

    • Tam

      #3
      Re: Odd Exception Trying To Load Form

      does the error happen when you call an empty constructor on the form? this
      will elminate your parameters as the possible source

      i.e. make a default

      FormA()
      {
      InitializeCompo nent();
      }

      i'd also check to see if you are adding controls in a loop, that would cause
      an error such as you are seeing.

      just a couple of thoughts :)

      "Dan" <ddeluca@fnisol utions.com> wrote in message
      news:08c101c3a9 8e$03dd22a0$a10 1280a@phx.gbl.. .[color=blue]
      > I am back yet again :)
      >
      > I am encountering an Exception that has me scratching my
      > head. I have two forms. Form A launches Form B in response
      > to the user clicking a button. The Constructor for Form B
      > takes 5 parameters but none of them complicated ( three
      > short strings and two booleans ). Form B does have several
      > controls on it (around 148 when you count in group boxes,
      > labes and menus). However, I have forms with far more that
      > load without a problem.
      >
      > The constructor simply sets 5 class values and of corse
      > the required InitializeCompo nent() call is there.
      > Everytime I attempt to load Form B I get the following
      > Exception
      >
      > System.StackOve rflowException: Exception of type
      > System.StackOve rflowException was thrown
      >
      > I can't figure out what the problem may be. If anyone has
      > any ideas I would greatly appreciate it. Thanks!
      >
      > Dan[/color]


      Comment

      • Dan

        #4
        Re: Odd Exception Trying To Load Form

        Tam and Michael,

        Thanks for your quick respondes to my post. You put me in
        the right direction and I was able to solve the problem.
        It turns out that I was trying to pass in a null value on
        one of my parameters. Once I fixed that it was running
        great. Thanks again!

        Dan

        Comment

        • Michael Culley

          #5
          Re: Odd Exception Trying To Load Form

          If passing a null param gives you a stack overflow then something still needs to be fixed.

          --
          Michael Culley


          "Dan" <anonymous@disc ussions.microso ft.com> wrote in message news:314901c3a9 ed$0b2938a0$a60 1280a@phx.gbl.. .[color=blue]
          > Tam and Michael,
          >
          > Thanks for your quick respondes to my post. You put me in
          > the right direction and I was able to solve the problem.
          > It turns out that I was trying to pass in a null value on
          > one of my parameters. Once I fixed that it was running
          > great. Thanks again!
          >
          > Dan[/color]


          Comment

          Working...