Disable Microsoft Visual C++ Runtime Error

2020-02-06 07:38发布

If my application crashes, a Microsoft Visual C++ Runtime Library "Runtime Error!" occurs.

The text of the message is:
This applicaton has requested the Runtime to terminate in an unusual way.
Please contact the application's support team for more information.

I know, that I need to solve all these issues, but I imagine that this error did not appear in the past. Is there an option in Visual Studio 2005 to enable/disable such error (handling)?. Instead I expect the application to just crash/exit and offer an Microsoft Windows Error Report.

2条回答
等我变得足够好
2楼-- · 2020-02-06 07:51

use:

_set_abort_behavior( 0, _WRITE_ABORT_MSG);
查看更多
啃猪蹄的小仙女
3楼-- · 2020-02-06 07:53

This error message appears if an exception is not handled and unexpected() is called or if an exception escapes a destructor during stack unwinding and terminate() is called. Both lead to abort() being called and its abort() implementation that shows the message box. This behaviour is by design in VS2k3, VS2k5 and VS2k8. It is really annoying especially in applications meant to run without human intervention (like daily builds for example).

You can workaround this behaviour - use catch(...) to catch all exceptions at the top level and set your own terminate() handler using set_terminate().

查看更多
登录 后发表回答