467,144 Members | 1,173 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,144 developers. It's quick & easy.

Odd Exception Trying To Load Form

Dan
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 InitializeComponent() call is there.
Everytime I attempt to load Form B I get the following
Exception

System.StackOverflowException: Exception of type
System.StackOverflowException was thrown

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

Dan
Nov 15 '05 #1
  • viewed: 1359
Share:
4 Replies
"Dan" <dd*****@fnisolutions.com> wrote in message news:08****************************@phx.gbl...
Everytime I attempt to load Form B I get the following
Exception

System.StackOverflowException: Exception of type
System.StackOverflowException was thrown


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

--
Michael Culley
Nov 15 '05 #2
Tam
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()
{
InitializeComponent();
}

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" <dd*****@fnisolutions.com> wrote in message
news:08****************************@phx.gbl...
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 InitializeComponent() call is there.
Everytime I attempt to load Form B I get the following
Exception

System.StackOverflowException: Exception of type
System.StackOverflowException was thrown

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

Dan

Nov 15 '05 #3
Dan
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
Nov 15 '05 #4
If passing a null param gives you a stack overflow then something still needs to be fixed.

--
Michael Culley
"Dan" <an*******@discussions.microsoft.com> wrote in message news:31****************************@phx.gbl...
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

Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by maricel | last post: by
reply views Thread by Darkoł | last post: by
reply views Thread by Eric Hudson | last post: by
44 posts views Thread by craig | last post: by
6 posts views Thread by Steve Long | last post: by
2 posts views Thread by Raju Joseph | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.