pothik05 <po******@discussions.microsoft.com> wrote:
Thanks for your reply. I can have a big try/catch in the method that starts
the thread and log the exception. But how will I "feed the exception back to
the main thread"? I can raise an event to notify the main program, but is
there any other way to catch any unhandled exception of the thread from the
main program.
No, you can't *catch* the exception in a different thread, but I'm not
sure why you'd want to, if all you need to do is log it.
To tell the main thread about the exception, just do the same as you
would for anything else which needs to get back to the UI thread - use
Control.Invoke or Control.BeginInvoke.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too