Re: Assertion vs Exception Handling
On Mar 12, 10:17 pm, Ian Collins <ian-n...@hotmail.com> wrote:
On 03/13/10 11:10 AM, Leigh Johnston wrote:
From Microsoft documentation:
[...]
I don't develop for windows, but isn't it asserts that pop up
that dialogue box asking if you want to debug or abort (if you
have VC++ installed) an application when it goes wrong?
That depends on the compiler options: you can chose between that
and a structured exception. If neither is appropriate (usually
the case when developing libraries, since you want to test that
your assertions trigger correctly), then you need to specify no
structured exceptions, explicitly catch SIGABRT, and also tell
the system that you don't want the popup otherwise, by calling
SetErrorMode.
This information is apparently well known in the Microsoft
community, because I hardly had to mention the issue in a
Microsoft forum to get a complete explination. I think you'll
find that a lot of Microsoft programmers are very professional
as well, and are capable of specifying what is appropriate for
their application as well.
--
James Kanze