Solved

Call Stack

Posted on 2001-06-19
3
183 Views
Last Modified: 2010-05-02
Hi,

I was wondering if it is possible to reproduce the call stack information in a compiled binary as if you had pressed CTRL+L in devel.,

i.e.

private sub whatever()
  on error goto errHandler

  ...

errHandler:
  if err.number <> 0 then
    msgbox callStack
  endif
end sub

public function callStack() as string
  //gathers and returns a string containing the call stack
end function

Any ideas?

Thanx

PS I will adjust the points as necassary.
0
Comment
Question by:wolfjjj
3 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6209300
i know that in  VB.net you will have this build-in, but in VB6- ?
listening & Learning
0
 
LVL 1

Accepted Solution

by:
morgan_peat earned 50 total points
ID: 6209575
We had this question not long ago.

The answer was something along the lines of:
Create your own 'stack' object (with push, pop, etc).  Each time you enter/leave a procedure, you 'push' the procedure name onto the stack, then 'pop' the name off again once you leave the procedure.  This'll keep track of where you are in the call stack.
Of course, you need to hard-code in each procedure name.
0
 
LVL 1

Author Comment

by:wolfjjj
ID: 6209586
It appears <= VB6 cant do what I've asked and morgan_peat has suggested a viable solution.

Thanx for you input.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

777 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