delphi package - automated exception handling
DmitryS
Posts: 5 Joined: Tue Nov 29, 2005 5:12 am
Post
by DmitryS » Tue Nov 29, 2005 5:23 am
madExcept can't catch exception rasing in thread from threads pool in Windows XP (QueueUserWorkItem)
madshi
Site Admin
Posts: 10753 Joined: Sun Mar 21, 2004 5:25 pm
Post
by madshi » Tue Nov 29, 2005 7:01 am
You can work around that by adding this around your thread code:
try
.. // real code here
except madExcept.HandleException end;
Do you happen to have a little test project lying around for me? Or could you eventually create one? I've never worked with QueueUserWorkItem yet!
Thanks!
DmitryS
Posts: 5 Joined: Tue Nov 29, 2005 5:12 am
Post
by DmitryS » Tue Nov 29, 2005 8:26 am
I send test project for bcb6
madshi
Site Admin
Posts: 10753 Joined: Sun Mar 21, 2004 5:25 pm
Post
by madshi » Tue Nov 29, 2005 8:32 pm
Thanks for the test program. I've added a special hook for
QueueUserWorkItem, which will be contained in the next
build.
DmitryS
Posts: 5 Joined: Tue Nov 29, 2005 5:12 am
Post
by DmitryS » Wed Nov 30, 2005 4:06 am
Thanks for good job (madExcept 3.0a).
Except QueueUserWorkItem, with threads pool work next function:
BindIoCompletionCallback
CreateTimerQueue
CreateTimerQueueTimer
madshi
Site Admin
Posts: 10753 Joined: Sun Mar 21, 2004 5:25 pm
Post
by madshi » Wed Nov 30, 2005 7:25 am
Ouch...
madshi
Site Admin
Posts: 10753 Joined: Sun Mar 21, 2004 5:25 pm
Post
by madshi » Wed Jan 04, 2006 2:20 pm
I've had a quick look at the other APIs, but I didn't manage to hook them on a quick try. You'll have to frame your timer and io completion callbacks with a try..catch call. In the catch block call "madExcept.HandleException".