Exceptions, DLL's and Threads
Posted on 1997-05-18
I'm working on an application which raises custom exceptions from inside a DLL. The exceptions are raised both from within the main thread as well as from a second thread (which exists inside the DLL).
Now, when the exception in the 2nd thread is raised, the default handler pops up behind all other windows!!
When the exception in the main thread (ie - inside the call to the DLL), the handler does not display and the message passed to the exception's Create constructor does not get displayed. Further, after closing the exception handler dialog, the application does not terminate!
If I wrap the DLL call in a try/except block, then re-raise the exception - there is no change. I can of course call Application.Terminate in my handler - but why should I have to?? And I can't do that with the exception in the 2nd thread because the call to the DLL returns before the exception gets raised!
One final puzzle - if I replace the default exception handler (ie: Application.OnException := My Handler), it NEVER gets called when a DLL exception is raised!!!
I'm obviously missing something pretty basic here .... any ideas?
Reply via email please, as I don't frequent this site