Re: dialog.domodal causes crash

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have an application that's worked well for two years. Recently I added
some code (a few functions and 2 calls to a dll) and now the program
crashes. Debug build is OK, Release build crashes and displays the MS "MFC
Application has encountered a problem".

I've put MessageBox'es at different points to identify where the crash
happens, and it seems to be at a call to mydialog.DoModal. The MessageBox
that I put in OnInitDialog doesn't display before the crash. This dialog is
not new, it's been there all along.

How would I go about tracking something like this down?

Dave,

You can debug the release build rather than having to put message
boxes in the code - have a look for "Turn on Generation of Debug
Information for the Release Build" in MSDN.

Since you've added new code, it would seem likely that something there
is the problem, so I'd start debugging by putting breakpoints in that
code.

When the crash occurs, have a look at the call stack and try to
identify the source of the problem.

Dave Lowndes
.



Relevant Pages

  • Re: (part 33) Han from China answers your C questions
    ... positive delta) then you can can more information from the crash since ... The same applies to incorrect results. ... But I'd rather debug incorrect results any day. ... although repeatable crashes can be easy to debug. ...
    (comp.lang.c)
  • Re: Screensaver Issues - Kernel32.DLL Error
    ... until you face the crash itself... ... the screensaver NEVER crashes if run from command-line (be it ... > Do you really think I didn`t debug the hell out of my code? ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: regsvr32 CRASH
    ... > can build it in debug or release mode and it diesn't crash. ... describe what happens when regsvr32 "crashes"? ... Prev by Date: ...
    (microsoft.public.win32.programmer.ole)
  • Re: upgrade 6-STABLE to -CURRENT on sparc64 renders box unusable
    ... it appears that ld-elf.so.1 crashes somewhere in __getosreldate. ... I have no idea how to debug this further. ... ^ crash appears to be here somewhere ...
    (freebsd-current)
  • Re: Program crashes when running it outside dev environment
    ... If I try to launch the debug on the ... crashing program, it'll close before the debugger opens. ... If it just fails strangely and sometimes inside system functions it might be overwritten memory or some such problem. ... Put one of those lines immediately before the line that crashes the program. ...
    (comp.lang.c)