lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [lmi] Catching exceptions thrown in OnInit()


From: Vadim Zeitlin
Subject: Re[2]: [lmi] Catching exceptions thrown in OnInit()
Date: Thu, 29 Jun 2006 15:03:40 +0200

On Wed, 28 Jun 2006 20:12:55 +0000 Greg Chicares <address@hidden> wrote:

GC> Using a non-null HWND whenver possible means that when I focus the
GC> application by any means whatsoever, I see the messagebox on top
GC> of the application, which just looks right to me, and the "top"
GC> window under the messagebox is disabled. Not only is it in fact
GC> disabled, it's also visibly disabled: its title bar is grayed,
GC> and I can't find any way to make it gain focus from the messagebox.
GC> For an application that has only one top window, isn't this ideal?

 I'm almost convinced... The only problem I see with this is that it
somewhat reduces the function robustness: currently it will show the
message in all but the most catastrophic situations (stack or GDI resources
exhaustion) while if we start using wxTheApp in it it could crash simple
because wxTheApp pointer is corrupted.

GC> However, if there is more than one top window, then yes, I guess
GC> the user could do something catastrophic. In that case, however,
GC> is it possible to disable every top window "manually" in wx until
GC> the messagebox is dismissed?

 This would further complicate the function and reduce its robustness...

GC> Even if it's a bother, still it's code that need be written only once,

 It's pretty trivial, in fact, there is a wxWindowDisabler class which does
just this. The only worry is that as we call more and more functions,
chances that we crash increase.


GC> There's another recurring problem report, with MSYS instead of MinGW
GC> gcc (the shell, not the compiler) that displays similar symptoms but
GC> has a different cause, IIRC. But both are fixed by flushing the
GC> standard streams explicitly, which is necessary anyway in case of an
GC> abend, so I figure it's always a good idea in a safe-message function.

 Yes, at the very least this should do absolutely no harm so I've just
added a fflush() call to wxSafeShowMessage(), thanks!
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]