自定义窗口断言 - 禁用“重试”按钮

发布于 2024-09-10 21:53:12 字数 197 浏览 3 评论 0原文

我在 C++ 代码中使用断言。众所周知,当断言条件为假时,它会弹出一个有关错误的窗口,其中包含三个按钮:中止、重试和忽略。我想解决这两种可能性: - 我想从弹出的窗口中禁用或删除“重试”按钮 - 我想将按钮中止或忽略按下的按钮定义为默认值。

您知道如何做到这一点吗?如果有一个解决方案来解决这个问题,那就太好了

提前非常感谢您

问候

I'm using asserts in my C++ code. As you all know, when the assert condition is false, it pops up a window about the error with three buttons: abort, retry and ignore. I would like to have a solution of this two possibilities:
- I would like to disable or delete the button "retry" from the windows that pops up
- I would like to define the button abort or the button ignore pressed as default.

Do you have any idea how to do this? It would be great to have a solution to solve that

Thank you very much in advance

Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栀梦 2024-09-17 21:53:12

如果您需要自定义功能,那么我建议编写您自己的断言处理程序是最简单、最灵活的解决方案。我不知道为什么你会想要花很大力气禁用“重试”,因为这是断言对话框最有用的方面之一:如果断言对话框关闭,那么点击重试将中断代码正确的点,以便您可以调试断言。您能解释一下您希望通过禁用它来实现什么目的吗?

If you need custom functionality then I'd suggest writing your own assertion handler is the easiest and most flexible solution. I don't know why you would want to go to the lengths of disabling the 'Retry' though since that's one of the most useful aspects of an assertion dialog: if the assertion dialog goes off then hitting retry will break into the code at the correct point so you can debug the assertion. Could you explain what you wish to achieve by disabling it?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文