|
-
Jun 17th, 2011, 04:11 AM
#1
Thread Starter
Member
out of stacks
Hi, all freinds,
what the meaning of (out of stacks), some times when I try to test an project made by vb6 , I get this message , need to know what it mean's and how to resolve it
many thanks for all
-
Jun 17th, 2011, 04:52 AM
#2
Re: out of stacks
in which code u get that msg?
-
Jun 17th, 2011, 08:12 AM
#3
Re: out of stacks
Probably actually "out of stack space."
Most of the time it means you have accidentally written a recursive procedure (Sub or Function that calls itself) when you did not mean to. Note that any use of DoEvents() calls means you have written such a procedure, and your program is always on he knife-edge of failure unless you have managed this by disable sources of events such as the control event that triggered the failing procedure.
There are other ways this can happen too, but they aren't as common. See http://en.wikipedia.org/wiki/Stack_overflow for a general description of what this error means.
-
Jun 17th, 2011, 08:38 AM
#4
Re: out of stacks
fkwinna
To build on dilletante's post #3 ...
If you are in Break Mode while debugging your app, you
will notice a Call Stack button on your Debug toolbar.
Basically, every time a sub calls another sub or function,
a new "line" is added to the Call Stack list. If you click on that
button, you will see this list, in reverse order (current sub at
the top, and initiating sub at the bottom).
There is a limit to how many procedures that can be on this list
(I'm not sure what that number is), and, as dilletante suggested,
if you have a "recursive procedure" situation, you will exceed that limit.
Spoo
-
Jun 17th, 2011, 09:14 AM
#5
Re: out of stacks
It isn't just the procedures themselves, but things like passed parameters and local data declared in the procedure. All of this takes stack space for every nested call.
-
Jun 17th, 2011, 09:55 AM
#6
Re: out of stacks
dillettante
I didn't realize that. Your Wiki link covers that nicely.
Thanks for clarification
Spoo
-
Jun 17th, 2011, 11:29 AM
#7
Thread Starter
Member
Re: out of stacks
This problem appeared when used, 35-formate in the project I work on the foundation you call any form of the 35, the order is as follows Alastdaa
Private Sub d1_Click ()
Form2.Show
me Unload
Here show the error message (out of stacks) mentioned and was forced to stop the activation of one of two commands and be the second
-
Jun 18th, 2011, 06:25 PM
#8
Re: out of stacks
Is there code in Form2_Load? Is there code in the _Unload sub of the form that you unload? If so please show it or them.
-
Jun 18th, 2011, 06:57 PM
#9
Thread Starter
Member
Re: out of stacks
Dearest Martinliss
thank's for your interest
the code in the main form as the following
Private Sub main1_Click()
Form10.Show
Unload Me
End Sub
Private Sub main2_Click()
Form12.Show
Unload Me
End Sub
-
Jun 18th, 2011, 08:23 PM
#10
Re: out of stacks
Sorry but what I asked you to show was the code (if any) in your Form_Load and Form_Unload subs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|