禁用Microsoft Visual C ++运行时错误 [英] Disable Microsoft Visual C++ Runtime Error

查看:166
本文介绍了禁用Microsoft Visual C ++运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的应用程序崩溃,则Microsoft Visual C ++运行时库运行时错误!"发生.

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.

我知道,我需要解决所有这些问题,但是我想这个错误过去从未出现过. Visual Studio 2005中是否有启用/禁用此类错误(处理)的选项?相反,我希望应用程序崩溃/退出并提供Microsoft Windows错误报告.

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.

推荐答案

如果未处理异常且调用了unexpected()或在堆栈展开期间异常逃脱了析构函数并调用了terminate(),则会出现此错误消息.两者都导致调用abort()及其显示消息框的abort()实现.此行为是设计使然在VS2k3,VS2k5和VS2k8中.确实很烦人,特别是在无需人工干预的情况下运行的应用程序(例如日常构建).

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).

您可以解决此问题-使用catch(...)在顶层捕获所有异常,并使用set_terminate()设置您自己的terminate()处理程序.

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

这篇关于禁用Microsoft Visual C ++运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆