Root > Advanced topics > Using EurekaLog in DLL > Using exception tracer with frameworks in DLLs

Using exception tracer with frameworks in DLLs

Previous pageReturn to chapter overviewNext page   

 

Important: as a general rule, you should write your application in a such way that it will behave correctly without EurekaLog on board. This means that if your or 3rd party code throws an exception in a DLL - it must be handled in a way that you expect. For example, by showing an error message, canceling action, retrying, etc. Once your application behaves like it is supposed to do - then you add EurekaLog for it. EurekaLog will auto-handle all unhandled exceptions automatically (by hooking few well-known places), and for everything else - you can call EurekaLog from your own handlers when needed. In other words:

Incorrect: your application does not show messages for exceptions (or do other things you want) from DLL and you are adding EurekaLog in hopes to fix this behavior;
Correct: your application correctly handles DLL exceptions and you are adding EurekaLog to receive reports about such exceptions.

 

The previous sections assumed that you write DLLs without using any frameworks. If you use framework (such as VCL or IntraWeb), then your actions will be slightly different. That's because framework already contain some sort of exception handling code.
 
A general concept would be the same. You can use either "Lightweight DLL" or "Standalone DLL" profiles for your DLLs. So the previous facts would be the same. Additionally, you have to configure DLLs for your framework. EurekaLog has support for common cases out of the box. For example, if you use Forms unit in your DLL (i.e. your DLL has forms) - then you need to hook Application.HandleException method. This can be done by enabling "VCL Forms application" option on Advanced/Code/Hooks page in EurekaLog project options. This is true for both "Lightweight DLL" and "Standalone DLL" profiles.
 
Note: "Standalone DLL" profile with "VCL Forms application" option on Hooks page is equal to "VCL Forms Application" profile. When you enable such options - DLL profile will be switched to "VCL Forms Application" profile. This is a normal behavior. After all, a profile is just set of predefined options. If you change options to match another profile - it will be shown as used. There is no build-in profile for "Lightweight DLL" profile with "VCL Forms application" option, so "Lightweight DLL" profile will not be changed after enabling option.
 
Now, let's change our example to illustrate this on practice. As usual, host application will remain unchanged. All changes will be done for DLL.

 

 

See also:




Send feedback... Build date: 2024-09-30
Last edited: 2024-07-08
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/dll_framework_exception_tracer.php