[Ace-users] [ace-users] C++ Exception handling model for Win32 builds

Adrian Tulloch my-ace-sub at reyes-tulloch.com
Wed Dec 12 02:07:02 CST 2007

Johnny Willemsen said:

> We also need this setting for the ACE_DISABLE_WIN32_ERROR_WINDOWS to work.
> We use this on all build systems to log access violations to a file instead
> of getting something on the screen. 

Are you sure? For me, calling SetUnhandledExceptionFilter prevents
dialogs from appearing on the screen after an access violation. The 
/EHa flag doesn't change the behaviour of the unhandled exception filter
in any way.

As a minor improvement, if we really do want to prevent win32 error
dialogs from appearing, we may want to consider calling
SetErrorMode(SEM_FAILCRITICALERRORS) in the code in the #ifdef
ACE_DISABLE_WIN32_ERROR_WINDOWS block. As things currently stand, I
believe that "Please Insert a disk in drive A:" and similar dialogs can
be shown.

> Can't you just override the default in
> your default.features file and regenerate the project files?

Sure, but you do understand just how undesirable the current behaviour
of catch(...) is, don't you? Just about every expert seems to strongly
recommend that you avoid the combination of /EHa and catch(...). If we
understand the risks and truly believe that there are benefits to /EHa,
then fine. But, as things currently stand I just see lots of risks and
not many benefits.


More information about the Ace-users mailing list