Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Call Stack

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
wolfjjj
Asked:
wolfjjj
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
i know that in  VB.net you will have this build-in, but in VB6- ?
listening & Learning
0
 
morgan_peatCommented:
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
 
wolfjjjAuthor Commented:
It appears <= VB6 cant do what I've asked and morgan_peat has suggested a viable solution.

Thanx for you input.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now