vb6 application: how can i create crash dump (drwatson)?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: vb6 application: how can i create crash dump (drwatson)?

  1. #1
    Join Date
    Apr 2009
    Posts
    4

    vb6 application: how can i create crash dump (drwatson)?

    hi!
    i need create crash dumps (such as drwatson) after vb6 application was crashed
    by any reason (such as access violation , zero divide , out of bounds , etc )

    what is the way to do that? (do not teach me turn drwnsn plz)
    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,982

    Re: vb6 application: how can i create crash dump (drwatson)?

    pretty sure there's an app in systernals (now Microsoft) toolkit. Not sure what kind of dump you expect from VB6, as it never did report that. Event logs might help
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,838

    Re: vb6 application: how can i create crash dump (drwatson)?

    I found this online http://www.vbaccelerator.com/home/VB...ng/article.asp

    On The Subject of Stack Traces

    It is possible to generate stack traces from a VB runtime. However, you're probably not going to like it. The technique is described in the May 2002 issue of Visual Studio Magazine in the article Get Debug Info From Production Apps by Dan Fergus. It uses a host of techniques from Matt Curland's excellent "Advanced Visual Basic 6" book to allow VB to determine the program's Instruction Pointer, Stack Pointer and Base Pointer and then use dbghelp.dll to translate these into readable descriptions (assuming that you have generated a Symbolic Debug Info file (PDB) when compiling the application - which means it doesn't work for P-Code apps).

    To use the code you need to include a class and 7 modules into the VB code you want stack tracking for, although they are all quite small. Then provided you are running outside the IDE, the VB code is compiled as Native Code and a PDB file has been created you can get a stack trace at any time by calling m_oSymbols.GetCallStack(). As far as I can tell it seems to work, but it is a shame it is impossible to isolate the code out of your project (I tried, but without success).
    The world would have been a much nicer place if VB provided an App.StackTrace method which worked at any time, but there you go. Actually, the world would have been better if the App object did anything properly!
    Best bet is to add error handlers and logging info into your app
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Apr 2009
    Posts
    4

    Re: vb6 application: how can i create crash dump (drwatson)?

    thanks for your answer.
    i have no difficulty to use windbg with vb6-application dumps and dbghelp.dll with vb6-runtime.
    it is not a matter.
    i just need to get dumps vb6-apps crash after it said MessageBox(e.g.) "Zero divizion".
    Now: when i catch exception, i cannt find its ExceptionCode because its _EXCEPTION_RECORD->ExceptionCode always is 0x8f (flt_inext_result). Because it i have to catch window with message about exception and save it's message and then cause access violation to crash application to get dump. Then in this dump i can see true reason of crash - the locaton of "zero divizion"(in this example).
    But it is very bad (stupid) method (i get not enough information, i can lose information at all). I need transparent method.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center