View Full Version : Stack too small error on exit
Andrew Beery
05-30-2007, 01:03 PM
When I exit an application with a form I get a "Stack Too Small" error... when the form wasn't called exit work fine... what am I missing?
//exit; //exit here works but no form obviously
f$ = optionsCreate;
if (ShowModal (f$, NULL, false) == 1)
end;
if (btnEnd$=="QUIT")
DestroyWindow(f$);
exit;
end;
kornalius
05-30-2007, 03:10 PM
Send me your application to support@arianesoft.ca I will take a look at it.
Are you getting your form (f$) on the screen or it doesn't show and the error message appears?
PointOfLight
05-30-2007, 07:49 PM
If you do a PostMessage(f$, WM_CLOSE, 0, 0); instead of using DestroyWindow do you still get the error?
Andrew Beery
05-31-2007, 02:25 AM
OK... I've sent the code... Eric I tried your postmessage suggestion... no difference... the Option form does do the WM_Close postmessage internally on it's close... really not sure why I need to do anything with the Option form at this point as the form has already closed... I tried the destroywindow after noticing the problem in the hope it might resolve the issue. I'd bet my bottom dollar I'm either not doing something I should be doing or doing it in the wrong order or place. Again... thanks for the help
kornalius
05-31-2007, 04:54 PM
The problem is with the Exit; function. You are exiting of a function that needs to return a value. Use Return(false) instead and it will fix your problem.
Andrew Beery
05-31-2007, 06:54 PM
Now don't I feel foolish!!!!!!!!!!!
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.