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



See below...
On Thu, 15 Nov 2007 09:38:04 -0800, Alan Williams-Key
<AlanWilliamsKey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

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?
****
Actually, this is not at all surprising; in fact, it might even be expected.
*****
I can
find no explanation of this in the help files.
****
Explanation of what? That release is different than debug?
****
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?
****
This has absolutely nothing to do with "MFC exception handling", which is completely
unrelated to the problem.

Run the release version under the debugger!
****

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).
****
This statement doesn't even make sense. If the access fault appears only in the release
version, it seems unlikely that it will appear in the debug version. You don't "make the
debug configuration" detect a bug that doesn't appear in the debug version.

See my essay "surviving the release version", on my MVP Tips site. Among other things, it
tells how to debug a release version.
joe
****

Alan
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Right Click context menu sometimes disables "Go To Definition" using VSl.NET 2005
    ... hover over the _DEBUG, there is no value shown and the AssertValid ... Also the the contained code for AssertValid() ... doesn't happen on a simple change of configuration. ... code in the code editor. ...
    (microsoft.public.vc.language)
  • Re: C++ debug/release builds and project references
    ... Is your class library in configuration "Release"? ... How do you add reference in the Winform project? ... suspect if you add the ManagedClassLib.dll in the debug folder. ... Creating command line "cl.exe ...
    (microsoft.public.dotnet.languages.vc)
  • Error while trying to debug
    ... When I was trying to open one of my ASP projects somewhere else, I got the following error message: ... Check to see that the project has a valid Web.config file, that the Web.config file sets "debug" to true, and that the debug verb is associated with .aspx. ... An error occurred during the processing of a configuration file required to service this request. ... Source Error: ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Can I change my code depending on the build type?
    ... "Release" configuration for one of projects in the solution - the only option ... is debug. ... if I set compilation debug="false" in web.config. ... the buffer is full or has lived a certain time, ...
    (microsoft.public.dotnet.framework.aspnet)
  • 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. ... I cannot save the crash dump produced which the exception handler offers to ...
    (microsoft.public.vc.mfc)