views:

22

answers:

1

Hello everyone,

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

+2  A: 

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?

the_mandrill
Very sensible, `+1` from me. Add to this that assertions will be removed in the release version, so that users will never see this dialog and won't have to guess whether they want to retry anything.
sbi
Absolutely, plus if you have your own handler it gives you the option of enabling asserts in a release build for internal testing.
the_mandrill