Solved

Out of Stack Space

Posted on 2004-08-16
6
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

749 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