Solved

Out of Stack Space

Posted on 2004-08-16
6
237 Views
Last Modified: 2010-05-02
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.

0
Comment
Question by:DavidBonfoey
  • 3
  • 2
6 Comments
 
LVL 18

Expert Comment

by:JR2003
ID: 11812789
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.

0
 

Author Comment

by:DavidBonfoey
ID: 11812852
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.

0
 
LVL 18

Accepted Solution

by:
JR2003 earned 125 total points
ID: 11812927
Is there anything strange about your 'loadfile' function?
You could paste it in here so we can see it?
Does the function return anything?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:DavidBonfoey
ID: 11813125
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.
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 11815370
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)


0
 

Author Comment

by:DavidBonfoey
ID: 11815402
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.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now