|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Ending the appliation reliablyHi all,
Is it safe to use application.exit or application.exitthread to end a program in .NET? If we didn't use the forms designer then there isn't any generated code to dispose of controls upon termination, would the above clear any resources up? Also, what if we have a multi-thread app? Perhaps it's better to use the API? Maybe TerminateProcess??? Adam Adam,
The best Net programs are withouth any API. When you had looked at the beginning in this newsgroup, it were all answers with API's. Given by VB6 guys/girls. Now you don't see them almost not anymore (they can be needed in some cases) In fact you don't have to set anything to close your application, the user does it with pushing the cross. While mostly the me.close from the mainform does it if you want to forsce this. The settup setting in your project properties tells how you start your project. This setting is a little bit different for the version 2002/2003 and 2005. Easier but more confusing in the first one. In a sub main class, the logic goes normally just to an end. One of the main points of managed code is to release all used managed recourses. I hope this helps, Cor Show quoteHide quote "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schreef in bericht news:OQtcP2bXGHA.2376@TK2MSFTNGP03.phx.gbl... > Hi all, > > Is it safe to use application.exit or application.exitthread to end a > program in .NET? > > If we didn't use the forms designer then there isn't any generated code to > dispose of controls upon termination, would the above clear any resources > up? > > Also, what if we have a multi-thread app? > > Perhaps it's better to use the API? Maybe TerminateProcess??? > > Adam >
Check if TIF file in use
ASP.NET page, hiding certain controls when printing Request for permission of the type 'System.Security.Permissions.RegistryPermission...' failed How to draw graphics on a bitmap ? Shared Methods In A Class ListView FocusedItem Tabbing not working in vb 6.0 forms form refresh? repaint? doevents? file system watcher prevents PC shutdown Maximize/Minimize form without API |
|||||||||||||||||||||||