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?

Thanks
Dave

Re: dialog.domodal causes crash by David

David
Fri Jul 18 16:52:23 CDT 2008

>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

Re: dialog.domodal causes crash by Dave

Dave
Fri Jul 18 17:54:41 CDT 2008

Dave -

Thanks for the ideas. I forgot to add this little tidbit - the debug mode
bypasses certain functions, since this is a machine control program and the
machine isn't hooked up to my development PC. I may have to resort to
installing the development system on the target machine.

Dave C

"David Lowndes" <DavidL@example.invalid> wrote in message
news:hr3284lnjhvvoe857fffja568v72ojm3hr@4ax.com...
> >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



Re: dialog.domodal causes crash by David

David
Sat Jul 19 03:10:17 CDT 2008

>Thanks for the ideas. I forgot to add this little tidbit - the debug mode
>bypasses certain functions, since this is a machine control program and the
>machine isn't hooked up to my development PC. I may have to resort to
>installing the development system on the target machine.

If you can get a network connection between the 2 you can use the
remote debugger which (if they're both modern OS's XP or higher I
think) will run from a share on the development machine.

Dave