Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view VB6 control-level variables in WinDbg?

I have a crash file where I can see that one of my own VB6 user controls is responsible for the crash; i.e. one of its methods is part of the stack trace and I can see the line responsible.

From here, I'd like to inspect the state of its member variables. How do I do this?

Note: I also have the private symbols for my controls. The problem is being able to inspect "Me". The command !object address_of_Me doesn't seem to do the trick and so I'm at a loss.

Thank you.

like image 340
John Avatar asked Jan 17 '12 16:01

John


1 Answers

It's been 10 years since I had to do this in VB6, but I remember a lot of Printer.Print statements in my past life :)

I used to do things like this for debugging (but not for release code)

Sub MySub
    On Error Goto ErrorTrap
    Dim intX as integer
    Dim intY as integer

    ' do some horrible error here

Exit Sub

ErrorTrap:
    Printer.Print "Error"
    Printer.Print intX
    Printer.Print intY
    Printer.Print ...

End Sub
like image 96
Derek Tomes Avatar answered Oct 22 '22 08:10

Derek Tomes