Link to home
Start Free TrialLog in
Avatar of molar
molarFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How can I see the VB6 Call Stack Programmatically?

Has anybody managed to access the VB call stack from the running program at runtime.

I want to produce an error handling module, this would be tremendously useful information to be able to get at this info.

Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

you could try

title : Q166275 HOWTO: Debug a Native Code Visual Basic Component in VC++
source : http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q166275

description
-------
you can build your exe or dll with symbols and use any debugger to see the call stack at runtime, or step through code if needed with the directions provided in the KB
-------

hope this helps a bit
Avatar of molar

ASKER

Thanks for the link. It looks like it's telling me how to debug the code using a separate debugger. What I am really after is a way to access the call stack from within the program itself as it is running.

I seem to remember reading an MS article saying this wasn't something that couldn't be done in VB6, but is supported in VB.NET.  I don't automatically believe MS when they say stuff like that though.

Slimy hack anyone?

what do you want to achieve
ASKER CERTIFIED SOLUTION
Avatar of AzraSound
AzraSound
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of molar

ASKER

Hi Bruintje

The way error handling has been done in the projects I have worked on,  often looks a little haphazard. I think that inconsistent error handling, and error handling that is not able to correctly point at the faulty function can damage developer confidence in library functions and so reduces reusability of code.

I am trying to come with a consistent error handling framework which will correctly pinpoint functions containing errors, even where the function containing the error is not the function reporting it.  This could happen for example if a function fails because it is passed invalid arguments by the function that invoked it. Hence what I'd really like is a way for a function to know any point, the chain of functions that invoked it (ie the call stack).

Azrasound.

Thanks for the dll. I'll give it a try. It certainly looks promising.


Avatar of molar

ASKER

I don't know if either of you have noticed (I only just did) but at the top of this page (on my screen at least) is an ad for "BuildVB". It looks like a commercial addin that is doing pretty much what I was looking for. It may be overkill for what I want, but I'll be checking that out too.



Avatar of molar

ASKER

I tried your DLL Azrasound. Fantastic. Just what I needed.

Glad I could help  :-)
Avatar of bashmaki
bashmaki

by: molar: I tried your DLL Azrasound. Fantastic. Just what I needed.
Where can I get this DLL. Link is broken now. Can anybody help?