Hi,I have to use nested & complex functions (call 3 functions inside a function) in my app. But I am sure that visual basic 6 stacks is not enough for my purpose. How can i increase stack?
Printable View
Hi,I have to use nested & complex functions (call 3 functions inside a function) in my app. But I am sure that visual basic 6 stacks is not enough for my purpose. How can i increase stack?
VB doesn't havea stack... the computer has a stack... why would you think that you would need more stack space?
-tg
Becase when i called a major function( a function which call 5 heavy functions inside of itself) all my sub functions worked perfectly but the next line after the major function didn`t execute.
I am using BASCOM too & there is an option for increasing Stack for functions. It gives me this ability to call more than 3 sub functions in a major function.
then something else is going wrong because I've created hundreds of funciton that call dozens of other functions, and in some cases that function is on a different machine from the app.... never had a problem. Something must be wrong with the functions you are calling or something... there's no reason just calling three functions would cause a problem.
-tg
Thank you from bottom of my heart.
akhileshbc - it's a .NET thing... called Remoting... I'm not sure that VB6 has that capability.
It's similar to calling a WebService, but it's different. Not sure I can explain it in a clear, comprehendable way.
Basically, you create an object (which has to implement the remoting interface), but you can't simply use
Dim something As New SomeObject
You have to use a special construct that tells VB 1) That it's a remote object and 2) Where that object is. The object then gets created on the machine at that location - it can be another server on the network, and it can even be the local machine. It's controlled by the config file. So, like in our case, we have a config file that we use during development that says to use the local machine, that way we can debug locally. Then the different servers from the different environments (QA, Testing, Production) have their configs set accordingly.
-tg
VB6.EXE seems to use the default stack reserve size, which is 1MB of virtual memory. It also seems to use the default commit increment (chunks the stack is extended by as needed). I can't find the default commit value though.
The initial stack is probably one or more commit sized blocks but extension to the full reserve amount is automatic.
Changing these two values is probably possible by relinking the EXE using the /EDIT switch along with the /STACK switch... or by manually altering the PE header of the EXE. As far as I know nobody ever does this.
Blowing the stack is almost always a sign of runaway recursion.
techgnome and akhileshbc, that would be DCOM in the world of VB6...
DCOM
Pretty fundamental to VB and Windows.