This code
#include <cassert>
int main()
{
assert(false);
return 0;
}
compiled like that
"/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 8/VC/BIN/amd64/CL.EXE
-MD -D_CONSOLE -nologo assertion.cpp
produces the output:
Assertion failed: false, file assertion.cpp, line 5
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
and then a popup window appears that tells me that it cannot find the Visual
Studio Just-In-Time Debugger.
HOW CAN I PREVENT THIS POPUP WINDOW
I would not expect this window to pop up, because the MSDN Library
says on the page about assert:
The destination of the diagnostic message depends on the type of application that called the routine. Console applications always receive the message through stderr. In a Windows-based application, assert calls the Windows MessageBox function to create a message box to display the message along with an OK button. When the user clicks OK, the program aborts immediately.
I defined _CONSOLEI disables just in time debugging in VC++ 2003 and VC8.
I run drwtsn -i so that it sets the registry entries in AeDebug and auto
I've XP64 on an AMD 64
Best regards,
andreas

Why is there a popupwindow for assert(false)
S.Bj-m
Flippin_Useless
I followed the link you gave. To me it seems that my problem is the other way round.
I don't want whatsoever popup window, but just an error report on the console.
For details, have a look at the non displayed comments at thea above URL.
charleste
code.
any other idea (besides that asserts are a bad idea)
andreas
Hanas
Hi,
This is a bug. It has been reported earlier. See http://connect.microsoft.com/feedback/ViewFeedback.aspx FeedbackID=101644&SiteID=210
Thanks,
Nikola
Stovesy
Fix the ASSERT! That is the best.
You can redirect the ASSERT with this to stderr
_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR );
Rateesh
ASSERT's a a bad thing and should not happen. So the programmer gets the chance in the dialog to break into the debugger to get directly to the location where the assert happens.
You can use _CrtSetReportMode to change the behaviour.
http://msdn2.microsoft.com/en-us/library/1y71x448.aspx
r2
Its a console application and
assert(false);
fails
Then on the console I get:
This application has requested the Runtime to terminante it in a unusual way.
Please contact the applications' support team for more information.
Then the popup window appears,
An unhandled win32 exception occured in assertion.exe. Just-In-Time debugging this
exception failed with the following error: No installed debugger has Just-In-Time-Debugging enabled.....
When I enable it in Visual Studio, it starts the debugger, so what kind of not works,
is that Dr Watson (which got registered with drwtsn32.exe) is not considered
as a good candidate.
Note that I am on XP64/Turion.
Jre1229
dguillory
ben999000
not to a popup window, because we run a batch job and not an interactive program