Hi Jekke, Can you put up a try/catch in the Close handler to see if any exception is being thrown during the execution of that code?
Cheers! Gaurav WinToolZone - http://www.wintoolzone.com/ Inside and Out - http://www.wintoolzone.com/blog/ > -----Original Message----- > From: [EMAIL PROTECTED] > Sent: Tue, 5 Jun 2007 17:42:50 -0400 > To: advanced-dotnet@discuss.develop.com > Subject: [ADVANCED-DOTNET] Guaranteeing code will run at shutdown > > All-- > > I have a WinForms application that must run a certain block of code > before shutting down. (Obviously, crashes can't be helped. I'm talking > about orderly shutdowns.) Shutdown is triggered by the closing of a main > form and the shutdown code currently executes in the handler for the main > form's .Closing event handler. > > However, the application often seems to close before all of the code in > the .Closing handler. Is there any way to prevent this? > > TIA > > --Jekke > > =================================== > This list is hosted by DevelopMentor. http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com ____________________________________________________________ GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails =================================== This list is hosted by DevelopMentor� http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com