Link to home
Start Free TrialLog in
Avatar of DavidBonfoey
DavidBonfoey

asked on

Out of Stack Space

I have a VB program (MDI parent).  When I run this on my development machine I get Run time error 28, out of stack space.  When I look at the stack it shows 2 things (the click event for the button and the subroutine that is doing something).  It does not give this error on the end user machines.

My development machine is a dog compared to the end user machines.  Could it be a memory constraint?

How do you set the stack size, or is it an actual problem.

Avatar of JR2003
JR2003

The stack size is fixed in VB.
You often get an out of stack space error if you are calling a function recursively.

Have a look at the call stack from the debug toolbar. There is a call stack viewer that looks like 4 white squares diagonally placed on top of each other with an arrow.

Avatar of DavidBonfoey

ASKER

I have done that when I run into the error and I show two open functions.  I called a click event (for a button) and that click calls a loadfile function.  Those two show up and disappear when the function is done

Those are the only things.

ASKER CERTIFIED SOLUTION
Avatar of JR2003
JR2003

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I narrowed it down to one line in the load script funciton.

I am passing a string to a control I have made on the form.  
bRet = Editor1.InsertCode(completedString)

The editor1 had been firing a on event command while doing the inserting code, causing the trouble.

Thanks for pointing me in the right direction, points are yours.
DavidBonfoey :

My experience with this error is that it is not directyl related to memory.

It happens only when an infinite loop or cascading event happens.

double check to see if  there is not a infinite loop, or recursive function or something
like those here:

bRet = Editor1.InsertCode(completedString)


I was calling a control which had an event fire during the call.  It was not recursive but it must have conflicted somehow:

Click Button
  Call LoadFile
    PutString into Control
      Call Event that Data Was Changed.....


This event was causing the headache as it must have extended the calls too far.