Suppress all Microsoft CRT dialog boxes
Useful e.g. when you don't want your automated tests to wait for a click in those dialog boxes upon a failure.
#ifdef _WIN32
int stfuHook(int, char*, int* returnValue)
{
if (returnValue)
*returnValue = 0;
return true;
}
#endif
int main(int argc, char * argv[])
{
#ifdef _WIN32
_CrtSetReportHook2(_CRT_RPTHOOK_INSTALL, stfuHook);
#endif
...
Written by Gregory Pakosz
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#C
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#