madExcept in a COM Object dll

delphi package - automated exception handling

madExcept in a COM Object dll

Postby bwdirks » Wed Nov 13, 2019 8:48 pm

I've written a COM Object DLL that is used with a 3rd party application that contains a COM Object API. I have madExcept compiled into my DLL but when an exception occurs madExcept does not handle the exception...nothing from madExcept gets displayed. I've tried searching the forum but almost everything I enter into the search edit box returns "...too many common words...".
Is there something special that is required to get madExcept to work in a COM Object DLL?
Posts: 19
Joined: Wed Feb 04, 2015 7:07 pm

Re: madExcept in a COM Object dll

Postby madshi » Wed Nov 13, 2019 9:52 pm

Does the first section of this page help?

Basically you need to add a try..except block around every "entry point" in your COM object dll. The reason is that whenever an exception occurs, the exception is "sent to" to the nearest try..except block. And if there is none inside of your COM object dll, then the exception goes to some other DLL or to the EXE, and is then outside of madExcept's control. That's how exception handling works in Windows.
Site Admin
Posts: 10209
Joined: Sun Mar 21, 2004 5:25 pm

Return to madExcept

Who is online

Users browsing this forum: No registered users and 47 guests