Which project files need to have madExcept enabled?
Posted: Wed Mar 27, 2019 2:53 pm
Hi,
I am evaluating madExcept for use with C++ Builder 10.2 in my software and I am wondering exactly how madExcept needs to be enabled in my various projects. I have numerous DLL and BPL files, all of which are used by the main executable and there are other executables (some of which are services that present no UI) that use only some of them.
I know that I will need to enable madExcept on the executables, and configure the exception box settings for the service executables to never show the box and instead always write the bug report to a file. In my understanding that will report on the uncaught exceptions.
I also have cases, mostly in the various low-level DLL files, where an exception is caught so that my software can recover as gracefully as possible but I would like to save the bug report for that exception to a file to allow for further debugging and troubleshooting. I have found that I can call HandleException inside of the "catch" block and that works fine. And so it seems that I will at least need to enable madExcept in the DLL/BPL projects that I want to call HandleException in, as those exceptions will not bubble up to the executable. Is this correct, or is there another way of accomplishing what I am trying to do without enabling madExcept in what will probably end up being nearly all of my DLL/BPL files?
Also, for release builds if madExcept is not enabled for a DLL/BPL module will the necessary information still be available to produce the stack trace? C++ Builder itself doesn't show nice stack traces when an exception happens in the IDE for release builds.
If I do need to enable madExcept in all of my DLL/BPL projects in order to do what I want, will changes to the properties in MESettings need to be made in code in each of the modules separately, or are they global settings for the entire application? It would be nice to not have to duplicate the code for setting those properties in every module, but I'm concerned most about handling the exceptions the proper way given the context of the executable. I can easily set the madExcept settings for each executable based on whether it presents a UI and should show the exception box, but if these settings need to be repeated in each of the low-level DLL files (in order to allow me to call HandleException wherever I want) then that could be problematic since it is a bit more complicated for the DLL to know the context of how it is running.
Thank you very much.
-- Adrian
I am evaluating madExcept for use with C++ Builder 10.2 in my software and I am wondering exactly how madExcept needs to be enabled in my various projects. I have numerous DLL and BPL files, all of which are used by the main executable and there are other executables (some of which are services that present no UI) that use only some of them.
I know that I will need to enable madExcept on the executables, and configure the exception box settings for the service executables to never show the box and instead always write the bug report to a file. In my understanding that will report on the uncaught exceptions.
I also have cases, mostly in the various low-level DLL files, where an exception is caught so that my software can recover as gracefully as possible but I would like to save the bug report for that exception to a file to allow for further debugging and troubleshooting. I have found that I can call HandleException inside of the "catch" block and that works fine. And so it seems that I will at least need to enable madExcept in the DLL/BPL projects that I want to call HandleException in, as those exceptions will not bubble up to the executable. Is this correct, or is there another way of accomplishing what I am trying to do without enabling madExcept in what will probably end up being nearly all of my DLL/BPL files?
Also, for release builds if madExcept is not enabled for a DLL/BPL module will the necessary information still be available to produce the stack trace? C++ Builder itself doesn't show nice stack traces when an exception happens in the IDE for release builds.
If I do need to enable madExcept in all of my DLL/BPL projects in order to do what I want, will changes to the properties in MESettings need to be made in code in each of the modules separately, or are they global settings for the entire application? It would be nice to not have to duplicate the code for setting those properties in every module, but I'm concerned most about handling the exceptions the proper way given the context of the executable. I can easily set the madExcept settings for each executable based on whether it presents a UI and should show the exception box, but if these settings need to be repeated in each of the low-level DLL files (in order to allow me to call HandleException wherever I want) then that could be problematic since it is a bit more complicated for the DLL to know the context of how it is running.
Thank you very much.
-- Adrian