my application crashed on release on a fprintf on null stream, and even if I added the catcher:
<code> #include <windows.h>
#include <iostream>
#include <errhandlingapi.h>
void errorCatcher()
{
std::cout << "Caught!n";
}
LONG windowsErrorCatcher(_EXCEPTION_POINTERS*)
{
std::cout << "Caught 2!n";
return EXCEPTION_CONTINUE_SEARCH;
}
int main()
{
SetUnhandledExceptionFilter(windowsErrorCatcher);
set_unexpected(errorCatcher);
set_terminate(errorCatcher);
fprintf(nullptr, "hello"); //<<??
std::cout << "Hello World!n";
}
</code>
<code> #include <windows.h>
#include <iostream>
#include <errhandlingapi.h>
void errorCatcher()
{
std::cout << "Caught!n";
}
LONG windowsErrorCatcher(_EXCEPTION_POINTERS*)
{
std::cout << "Caught 2!n";
return EXCEPTION_CONTINUE_SEARCH;
}
int main()
{
SetUnhandledExceptionFilter(windowsErrorCatcher);
set_unexpected(errorCatcher);
set_terminate(errorCatcher);
fprintf(nullptr, "hello"); //<<??
std::cout << "Hello World!n";
}
</code>
#include <windows.h>
#include <iostream>
#include <errhandlingapi.h>
void errorCatcher()
{
std::cout << "Caught!n";
}
LONG windowsErrorCatcher(_EXCEPTION_POINTERS*)
{
std::cout << "Caught 2!n";
return EXCEPTION_CONTINUE_SEARCH;
}
int main()
{
SetUnhandledExceptionFilter(windowsErrorCatcher);
set_unexpected(errorCatcher);
set_terminate(errorCatcher);
fprintf(nullptr, "hello"); //<<??
std::cout << "Hello World!n";
}
maybe there is another method to catch it?