Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Call Stack

Posted on 2001-06-19
3
Medium Priority
?
199 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
[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 Comments
 
LVL 143

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 200 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
Suggested Courses

604 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