, what() . catch , , -. :
class ExceptionOutputDebug : public std::exception
{
public:
ExceptionOutputDebug(const std::exception& e)
{
OutputDebugString(e.what());
OutputDebugString("\n");
if (1)
throw e;
}
};
:
throw ExceptionOutputDebug(std::runtime_error("Die"));
:
Die
First-chance exception at 0x76CAC42D in blah.exe: Microsoft C++ exception: std::exception at memory location 0x019EFEBC.
, , . , , OutputDebugString - ( , printf ).