Click here to Skip to main content
15,885,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalwebbrowser Pin
imajit25-May-03 19:12
imajit25-May-03 19:12 
GeneralWeb Crawler or Web Spider Books Pin
Steve ParmIey25-May-03 17:42
Steve ParmIey25-May-03 17:42 
Generalwebbrowser Pin
imajit25-May-03 17:39
imajit25-May-03 17:39 
GeneralRe: webbrowser Pin
Michael Dunn25-May-03 19:06
sitebuilderMichael Dunn25-May-03 19:06 
Generalmfc and "switch" statements Pin
shanila25-May-03 16:52
shanila25-May-03 16:52 
GeneralRe: mfc and "switch" statements Pin
John R. Shaw26-May-03 10:55
John R. Shaw26-May-03 10:55 
GeneralMFC dialog enigma Pin
Beer25-May-03 16:08
Beer25-May-03 16:08 
QuestionHow do I check for stack oevrflow in recursive functions Pin
Rahul Singh25-May-03 15:09
Rahul Singh25-May-03 15:09 
Hi,

I have a MFC application that contains a recursive function. After going in approx 4500 - 4900 levels deep the application crashes without an error. It just disappears from the screen. I am assuming that the recursion is going so deep that it is killing the stack.

Is there a way to check for this and return before the stack overflows?

Here is my code.
void CMyAppDlg::DoWork(int i)
{
	if(i == 4900)
          return;
	DoWork(i+1);
}

void CMyAppDlg::OnButton1(int i)
{
      AfxMessageBox("Starting work!");
      DoWork(0);
      AfxMessageBox("Done working!");
}

I can probably implement my method without recursion (its a tree parse) but I'd like to know if there is a solution to this. Any help will be appreciated.

Cheers,

Rahul
http://www.cs.cmu.edu/~kingtiny
AnswerRe: How do I check for stack oevrflow in recursive functions Pin
ZoogieZork25-May-03 16:55
ZoogieZork25-May-03 16:55 
GeneralRe: How do I check for stack oevrflow in recursive functions Pin
Neville Franks25-May-03 23:34
Neville Franks25-May-03 23:34 
AnswerRe: How do I check for stack oevrflow in recursive functions Pin
John R. Shaw26-May-03 11:11
John R. Shaw26-May-03 11:11 
QuestionHow do I make a pie chart in MFC?? Pin
IrishSonic25-May-03 13:39
IrishSonic25-May-03 13:39 
AnswerRe: How do I make a pie chart in MFC?? Pin
valikac25-May-03 14:22
valikac25-May-03 14:22 
AnswerRe: How do I make a pie chart in MFC?? Pin
John R. Shaw26-May-03 11:17
John R. Shaw26-May-03 11:17 
Questionfrom MFC's view, do u like .net and c#? Pin
includeh1025-May-03 10:53
includeh1025-May-03 10:53 
GeneralProblem with URL link in richeditctrl (with CFE_LINK) Pin
Florin Ochiana25-May-03 9:48
Florin Ochiana25-May-03 9:48 
GeneralRe: Problem with URL link in richeditctrl (with CFE_LINK) Pin
Michael Dunn25-May-03 16:47
sitebuilderMichael Dunn25-May-03 16:47 
QuestionWM_MOUSEHOVER and TRACKMOUSEEVENT unknown? Pin
tareqsiraj25-May-03 8:33
tareqsiraj25-May-03 8:33 
AnswerRe: WM_MOUSEHOVER and TRACKMOUSEEVENT unknown? Pin
User 665825-May-03 8:39
User 665825-May-03 8:39 
GeneralRe: WM_MOUSEHOVER and TRACKMOUSEEVENT unknown? Pin
tareqsiraj25-May-03 15:00
tareqsiraj25-May-03 15:00 
QuestionWS_EX_NOACTIVATE not there? Pin
John Kohn25-May-03 8:13
sussJohn Kohn25-May-03 8:13 
AnswerRe: WS_EX_NOACTIVATE not there? Pin
User 665825-May-03 8:41
User 665825-May-03 8:41 
QuestionHow to disable an initial selection in CEdit? Pin
kydfru25-May-03 4:51
kydfru25-May-03 4:51 
AnswerRe: How to disable an initial selection in CEdit? Pin
valikac25-May-03 4:59
valikac25-May-03 4:59 
GeneralNo such property ... Pin
kydfru25-May-03 5:08
kydfru25-May-03 5:08 

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.