I keep getting this error. Is there a way to clear the stack? TIA.
Oliver Sturm - 22 Aug 2005 13:10 GMT
> I keep getting this error. Is there a way to clear the stack? TIA.
You don't want to clear the stack. You are most probably getting this
error because you have somehow initiated a recursion that doesn't ever
return. This results in a stack overflow because for each call to a
method, the stack is used to store the return "address" for the call.
You should have a look at the call stack (one of the debugger windows)
you get in VS when this exception is thrown, to find out where exactly
the problem occurs.
Oliver Sturm

Signature
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog
Jon Skeet [C# MVP] - 22 Aug 2005 18:22 GMT
> I keep getting this error. Is there a way to clear the stack? TIA.
That would fix the symptom rather than the problem (even if it were
possible, which it isn't). Chances are you're recursing too deeply. A
common source of this problem is making a property refer to itself, eg:
public int Foo
{
get
{
return Foo;
}
set
{
Foo = value;
}
}
If that's not it, could you post a short but complete program which
demonstrates the problem?
See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Bob Powell [MVP] - 22 Aug 2005 21:46 GMT
I bet you've used a property name within the accessor for the property such
as:
int foo
{
get{return foo;}
set{foo=value;}
}

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
>I keep getting this error. Is there a way to clear the stack? TIA.