自定义窗口断言 - 禁用“重试”按钮
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您需要自定义功能,那么我建议编写您自己的断言处理程序是最简单、最灵活的解决方案。我不知道为什么你会想要花很大力气禁用“重试”,因为这是断言对话框最有用的方面之一:如果断言对话框关闭,那么点击重试将中断代码正确的点,以便您可以调试断言。您能解释一下您希望通过禁用它来实现什么目的吗?
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?