I've tried this SO answer: How can I disable the debug assertion dialog on Windows?.
Still, no luck.
The code I'm using:
#include <Windows.h>
#include <crtdbg.h>
#include <cassert>
int test(int reportType, char* message, int* returnValue)
{
return 0;
}
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
_CrtSetReportHook(&test);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
//_ASSERT(0); // works as expected: no dialog appears
assert(0); // The dialog appears
return 0;
}
Maybe, there is something wrong with my system's config?