MFC Application has encountered a problem and needs to close. HELP



This is driving me nuts.

Whenever I run my program in release configuraiton it always crashes with
the above error message offering me an option to send a message to Microsoft.
I have discovered it is an access violation (code 5).

Whenever I run the program in debug configuration it runs OK.

I have two main questions:
1 How can the program behave so differently in the two configurations? I can
find no explanation of this in the help files.
2 How can I get useful information about the access violation?

I cannot save the crash dump produced which the exception handler offers to
send to Microsoft for me because it is deleted as soon as I click out of the
dialog and my Norton wizard for recovering lost files doesn't look in the
right directory. Is it possible to disable the MFC exception handling so that
I can generate a drwtsn32 crash dump? If I can, will Visual Studio 6.0 read
it?

I have tried analysing the stack dump in the crash file (a laborious process
using the small scroll window in the report viewer) to find addresses from my
program space, but so far this hasn't led to anything.

Ideally I would like to make the debug configuration detect the access
violation so that I can investigate but I cannot find any options that allow
me to force the debug version to behave in the same way as the release
version. Is there such an option (this is obviously related to my main
question No 1).

Alan
.



Relevant Pages

  • Re: MFC Application has encountered a problem and needs to close. HELP
    ... the above error message offering me an option to send a message to Microsoft. ... Whenever I run the program in debug configuration it runs OK. ... This has absolutely nothing to do with "MFC exception handling", ...
    (microsoft.public.vc.mfc)
  • Re: Cant find .lib files in custom SDK
    ... You can use either Release or Debug configuration, ... > way to build the SDK according to "debug" configuration? ... >> Does the selected configuration match your current sysgened ...
    (microsoft.public.windowsce.platbuilder)
  • dr. watson dont catch a crash
    ... udp and tcp network packets) crashes down. ... i configured dr. watson to make a crash dump. ... first running dr. watson and setting crash file configuration, ...
    (microsoft.public.vc.debugger)
  • Re: Step by step it works but...
    ... the Debug configuration when you run the app without debugging. ... When I execute it, the program fails ...
    (microsoft.public.dotnet.languages.vb)
  • Building other configurations from active configuration
    ... I have an application with international support in a Visual C++ 6.0 ... My primary configuration is my debug configuration. ...
    (microsoft.public.vc.ide_general)