B
Bob Day
Using VS 2003, VB, MSDE...
I am stoping a thread with the following code:
Try
Thread.CurrentThread.Abort()
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
The MessagBox shows, but then after the End Try it traverses the call stack
all the way to the top (same thread) and the exception is caught again by a
Try/Catch that is around everthing that happens in this thread.
1) Why does the top level try catch get involved at all when it is caught
locally?
2) I don't really want to thow an exception, I just want to kill the thread.
It seems that setting it to nothing accomplishes the same thing. Is there
any disadvantage to doing it this way?
Thanks!
Bobg
I am stoping a thread with the following code:
Try
Thread.CurrentThread.Abort()
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
The MessagBox shows, but then after the End Try it traverses the call stack
all the way to the top (same thread) and the exception is caught again by a
Try/Catch that is around everthing that happens in this thread.
1) Why does the top level try catch get involved at all when it is caught
locally?
2) I don't really want to thow an exception, I just want to kill the thread.
It seems that setting it to nothing accomplishes the same thing. Is there
any disadvantage to doing it this way?
Thanks!
Bobg