Re: Splash Screen - My Nemesis
Daniel Barla-Szabo <[email protected]> Fri, 27 Jul 2007 08:32:22 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
This might be slightly off-topic, but I think it's sometimes nice to add event handlers to the following two events: Application.ThreadException AppDomain.CurrentDomain.UnhandledException You can do this on your main method, before you even fire the main form. If you have the event handlers in place, the exceptions should not bubble all the way to the user directly. Although in general I think it's best to try and handle the exceptions when and where they occur, this is not always possible (I'm thinking along the lines of 3rd party components which handle UI events directly, giving you no opportunity to inject a try / catch). In these cases I find it better to give the user a slightly more friendly error screen, giving them the option to log the error and exit / continue the app. -- Daniel. -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Brady Kelly Sent: 26 July 2007 03:48 PM To: [email protected] Subject: Re: [DOTNET-WINFORMS] Splash Screen - My Nemesis Or they bubble wrong? I added an exception handler to my Main method last night, so maybe that was in conflict with my error dialog and splash screen. Maybe there isn't room for all three. > -----Original Message----- > From: Discussion forum for developers using Windows Forms to build apps > and controls [mailto:[email protected]] On Behalf Of > Greg Robinson > Sent: 26 July 2007 15:43 PM > To: [email protected] > Subject: Re: [DOTNET-WINFORMS] Splash Screen - My Nemesis > > If I recall from memory, when calling show or showdialog on an instance > of a > form, any exceptions thrown inside the load event handler for that form > do > not bubble back up to the calling code. > > > > > Greg Robinson > Custom Data Systems, Inc. > www.cds-am.net > > -----Original Message----- > From: Discussion forum for developers using Windows Forms to build apps > and controls [mailto:[email protected]]On Behalf Of > Fabian Schmied > Sent: Thursday, July 26, 2007 9:26 AM > To: [email protected] > Subject: Re: [DOTNET-WINFORMS] Splash Screen - My Nemesis > > > > > handling exceptions in the Load ... don't do it, it's unpredictable > > > > Same experience here - unpredictable... quite frustrating the first > > time you run into it :) > > Can you give a little more information on that? Is this about > Application.ThreadException, AppDomain.UnhandledException, or general > try/catch blocks? > > Ideally, I'd like to see a code sample of a case where exception > handling doesn't play well with Load, I'm quite interested in that. > > Fabian