Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2005

Tip: Looking for answers? Try searching our database.

StackOverFlowException

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Niggy - 22 Aug 2005 12:10 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.