Click here to Skip to main content
15,912,507 members
Home / Discussions / C#
   

C#

 
QuestionSaving form or panel as an object Pin
Naveed72721-Jan-09 22:44
Naveed72721-Jan-09 22:44 
AnswerRe: Saving form or panel as an object Pin
musefan21-Jan-09 22:52
musefan21-Jan-09 22:52 
GeneralRe: Saving form or panel as an object Pin
Naveed72721-Jan-09 22:54
Naveed72721-Jan-09 22:54 
GeneralRe: Saving form or panel as an object Pin
Dave Kreskowiak22-Jan-09 2:06
mveDave Kreskowiak22-Jan-09 2:06 
AnswerRe: Saving form or panel as an object Pin
DaveyM6921-Jan-09 23:15
professionalDaveyM6921-Jan-09 23:15 
GeneralRe: Saving form or panel as an object Pin
Naveed72721-Jan-09 23:19
Naveed72721-Jan-09 23:19 
GeneralRe: Saving form or panel as an object Pin
Tom Deketelaere21-Jan-09 23:27
professionalTom Deketelaere21-Jan-09 23:27 
GeneralRe: Saving form or panel as an object Pin
Naveed72721-Jan-09 23:35
Naveed72721-Jan-09 23:35 
GeneralRe: Saving form or panel as an object Pin
Tom Deketelaere21-Jan-09 23:59
professionalTom Deketelaere21-Jan-09 23:59 
GeneralRe: Saving form or panel as an object Pin
DaveyM6921-Jan-09 23:48
professionalDaveyM6921-Jan-09 23:48 
GeneralRe: Saving form or panel as an object Pin
Naveed72722-Jan-09 0:13
Naveed72722-Jan-09 0:13 
GeneralRe: Saving form or panel as an object Pin
DaveyM6922-Jan-09 0:40
professionalDaveyM6922-Jan-09 0:40 
AnswerRe: Saving form or panel as an object [modified] Pin
moon_stick22-Jan-09 0:11
moon_stick22-Jan-09 0:11 
GeneralRe: Saving form or panel as an object Pin
Naveed72722-Jan-09 1:20
Naveed72722-Jan-09 1:20 
QuestionHow to avoid stack overflow ? Pin
Spunky Coder21-Jan-09 22:13
Spunky Coder21-Jan-09 22:13 
AnswerRe: How to avoid stack overflow ? Pin
Pete O'Hanlon21-Jan-09 22:40
mvePete O'Hanlon21-Jan-09 22:40 
AnswerRe: How to avoid stack overflow ? Pin
#realJSOP22-Jan-09 0:14
professional#realJSOP22-Jan-09 0:14 
GeneralRe: How to avoid stack overflow ? Pin
S. Senthil Kumar22-Jan-09 3:05
S. Senthil Kumar22-Jan-09 3:05 
AnswerRe: How to avoid stack overflow ? Pin
Guffa22-Jan-09 0:35
Guffa22-Jan-09 0:35 
GeneralRe: How to avoid stack overflow ? Pin
Spunky Coder26-Jan-09 22:34
Spunky Coder26-Jan-09 22:34 
GeneralRe: How to avoid stack overflow ? Pin
Guffa27-Jan-09 1:22
Guffa27-Jan-09 1:22 
AnswerRe: How to avoid stack overflow ? Pin
Ben Fair22-Jan-09 4:43
Ben Fair22-Jan-09 4:43 
There is probably something going wrong in the recursion as the nesting should not really get that deep. When the exception occurs take a second to look at the stack trace in the debugger and get an idea of how deep the recursion got. However, to answer your question the alternate of recursion is to use and manage a Stack yourself. Using the Generic Collections from .NET 2.0, you can use Stack<T> for this purpose. It's really the same concept as recursion because in recursion you're using the call stack and the system is managing it for you. Anyhow, there are bunches of good articles on the internet of how to mimic recursion with a stack; off-hand I found this one:

http://haacked.com/archive/2007/03/04/Replacing_Recursion_With_a_Stack.aspx[^]

Hope that helps!

Keep It Simple Stupid! (KISS)

GeneralRe: How to avoid stack overflow ? Pin
Spunky Coder26-Jan-09 23:05
Spunky Coder26-Jan-09 23:05 
GeneralRe: How to avoid stack overflow ? Pin
Guffa27-Jan-09 1:27
Guffa27-Jan-09 1:27 
GeneralRe: How to avoid stack overflow ? Pin
Ben Fair27-Jan-09 4:11
Ben Fair27-Jan-09 4:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.