Terminate A Program Immediately From Try Catch?Jan 19, 2010
I am trying to end a program immediately when a critical exception is caught. But I am finding that code after my Try/Catch block is executing even though the code withing the Catch block is executing, and that Catch code is calling Me.Close.
I suspect it has something to do with background .net threads or something, but I have no clue how to deal with those kinds of issues. How can I stop the program as quickly as possible? If code after my Catch executes, it will (and does) throw lots of uncaught exceptions later. Currently, it is not feasible for me to try to catch all the other exceptions. I just want to report an error and end the program.In my form load routine, I create and set up a number of objects and arrays by calling various subroutines.The success of most of the subroutines depends on the sucess of three subs in particular, which are called early on. If one of those three fails, there will undoubtedly be a number of hard to trap exceptions later on in the load routine.