Re: Tips to hide "Debug Assertion Failed!"



Assert failures only come from the debug version. So you must have the symbol _DEBUG
defined somewhere, perhaps in a library build. Note that ASSERT statements are different
from the sort of message that indicates an uncaught exception, which is a different
problem, and also represents a bug in your program.
joe

On Mon, 20 Jun 2005 15:45:50 -0600, "Johnson Liuis" <gpsabove@xxxxxxxxx> wrote:

>Thanks for your reply, Joseph,
>
>Just let you know that the rror message happened in a release version, not a
>debug version. I am sure in the "Active Configure" I selected "Win32
>Release", and that is why I got surprised. Any idea?
>
>Johnson
>
>
>
>
>
>
>"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
>news:c79bb1p2dsgcr7nck6ne9hm4be1pj9ru81@xxxxxxxxxx
>> There is a highly-effective way to "hide" this message box: fix the bug
>> that caused it!
>>
>> Note that you ARE released a debug version, which poses problems, because
>> the debug DLLs
>> for MFC are not redistributable. ASSERTs do not come out in the release
>> version; instead,
>> the program screws up in some other way, usually resulting in either
>> misbehavior or
>> something more serious like an access fault. In the release version,
>> ASSERTs compile out
>> and produce no code.
>>
>> It would be inappropriate to have a message box that said "You have
>> encountered a bug
>> caused by your operating system" when the truth is "I screwed up, and you
>> are the victim".
>> An ASSERT fault is *always* a bug in your program. Fix it.
>>
>> Why would you want to misrepresent your errors as operating system errors?
>> Why would you
>> want to blame your bugs on Microsoft? Why would you not endeavor to fix
>> the bugs you have
>> created?
>>
>> Do the job right! Don't try to pretend the bug isn't yours when it is.
>> joe
>>
>>
>> On Sat, 18 Jun 2005 21:21:41 -0600, "Johnson Liuis" <gpsabove@xxxxxxxxx>
>> wrote:
>>
>>>I am using Visual Studio 6.0 to develop a GUI software. Sometimes when I
>>>tested the software in a different OS, I can get the following error
>>>message:
>>>
>>>"Microsoft Visual C++ Debug Library
>>>Debug Assetion Failed!
>>>Program:...
>>>File: ...
>>>Line: ..."
>>>
>>>I do not like this kind of message box being displayed, since it looks
>>>like
>>>that I am releasing a "debug" version. In case there is an error occurred,
>>>I
>>>would like to use my own warning message box instead. For example, I would
>>>like to show "You have encountered a problem caused by your operating
>>>system. Try to run the software in Windows XP instead." Could anybody let
>>>me
>>>know if there is a back door that I can hide "Debug Assertion Failed"
>>>message in my software?
>>>
>>>Thanks in advance.
>>>
>>>Johnson
>>>
>>>
>>>
>>>
>>
>> Joseph M. Newcomer [MVP]
>> email: newcomer@xxxxxxxxxxxx
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>

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



Relevant Pages

  • Re: Weird error during programme startup
    ... Microsoft Visual C++ Debug Library ... I've stepped through the innards of _initterm and it ... it won't assert in release builds. ... You said that you moved all strings to string tables. ...
    (microsoft.public.vc.language)
  • Using debug print routine inside assert
    ... The idea here is to have consistent debug print messages. ... If you could skip the evaluation of debug, ... return True # return true so that assert always succeeds ... nevertheless, in Python, you don't have such thing as macros. ...
    (comp.lang.python)
  • Re: Assertion in DEBUG and RELEASE
    ... >> code is like this, I was getting a pointer, and check with an ASSERT ... Those bugs should be fixed for a release build, ... The debug CRT initializes that memory with NULL, ... Also notable: compilers ...
    (microsoft.public.vc.language)
  • Re: behaviour of vector::operator[]
    ... > programming. ... assert to check the precondition. ... Moreover for debug purposes, you ... checks in certain places using some sort of asserts, not exceptions. ...
    (microsoft.public.vc.stl)
  • Re: How to disable assertions of mfc core libraries ?
    ... Note that what this means is that the release version is full of the same bugs the debug ... Apparently the OP missed the point that an ASSERT means "you have a bug here you have to ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)