madExcept in a COM Object dll

delphi package - automated exception handling
Post Reply
bwdirks
Posts: 19
Joined: Wed Feb 04, 2015 7:07 pm

madExcept in a COM Object dll

Post by bwdirks »

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?
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept in a COM Object dll

Post by madshi »

Does the first section of this page help?

http://help.madshi.net/HowToUseMadExcept.htm

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.
Post Reply