Exception and Thread

06fbf7a500fa08bc3bf6d5ff5dd6c011
0
lestat 101 Jun 18, 2005 at 04:02

In my program i catch exception in branch thread and i need deliver its in main thread.

1 Reply

Please log in or register to post a reply.

48d5487f357fbcacc89e84720577f0ac
0
Steven_Hansen 101 Jun 20, 2005 at 15:20

@lestat

In my program i catch exception in branch thread and i need deliver its in main thread. [snapback]18194[/snapback]

You won’t be able to “catch” exceptions anywhere except in the call stack that created the exception in the first place. That’s the way exceptions work.

If you catch an exception in one thread, and wish to alert another thread about the problem, the standard way to communicate between threads (in the case of windows) is to use events. You set the event in one thread, then use WaitForSingleObject (or one of its siblings) to check for that event.

Good luck.