Urgent help - stack problems

farkwit
09-03-2000, 07:56 AM
I keep getting an error message after a while of running my program that says "Out of stack space" what the hell does this mean, and how can i stop this happening?

Sparkey
09-03-2000, 11:35 AM
Looks like you are using too much recursion in your program. An "Out of Stack Space" error can easily occur if your program performs uncontrolled recursion, such as a cascading event. Recursion also occurs when a procedure calls itself, often repeatedly.

If you have a lot of nested prodedures, then here's what happens. For example, an event procedure can call a second procedure, which can call a third procedure...and so on — all before the event procedure that started this chain is completed. All of these are on the stack at once and if an event is then called again while it is on the stack the stack gets full.

It can also be caused if you have too many fixed-length strings. Fixed-length strings in a procedure are more quickly accessed, but use more stack space than variable-length strings, because the string data itself is placed on the stack

The MSDN Library, available online, has quite a bit of info on this. It comes under the title "Out Of Stack Space" (Error 28)

Debug your code thoroughly and use the Calls dialog box to view which procedures are active on the stack.

To display the Calls dialog box, select the Calls button to the right of the Procedure box in the Debug window or choose the Calls command.

anaim
09-04-2000, 04:33 AM
I have a similiar problem, but it's not a matter of recursion or cascade. I still haven't figured out where the problem is.
When I load a form (with no code both in the activate or load events) that error apears. But if I compile the project, as an '.exe' the error doesn't happen. Till now I haven't found an explanation to this.
If I use breaks, it blows exacly on the '.show 1' method line.

I've no idea about what causes this, but as it works when compiled, I stop boring about the problem.


ANA MONTEIRO

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum