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

Multiple instances of exception tracer

Previous pageReturn to chapter overviewNext page   

Important notice: Windows 2000 does not provide any way to set exception hook in documented way. This means that any exception tracer have to install low-level injecting hook for internal routines. Only single module can install such hook reliably for the same routine. If two or more different modules attempt to install such hook - it will either fail or crash. Therefore, it's highly not recommended to use multiple instances of exception tracers on Windows 2000. Windows XP and above do not have such issues, because newer systems allow you to install arbitrary amount of exception hooks via documented API. This API is called VEH: Vectored Exception Handling. If you can't use single instance of exception tracer and have to support Windows 2000: we suggest to use Delphi 2009 or above and disable "Use low-level hooks" option. Delphi 2009 introduced better integration between application and exception tracer. It allow you to react on hi-level exceptions without need to install low-level hook (however, low-level hook still may be installed to capture CPU state). Combination of Windows 2000 and any IDE before 2009 (such as Delphi 7) will not work reliably for multiple instances of exception manager - regardless of options in those modules.


Open/create DLL, enable EurekaLog and set application type to "Standalone DLL". Since we're going to use forms in our DLL - go do Advanced/Code/Hooks page in EurekaLog project options and enable "VCL Forms application" option. Also change dialog to "MS Classic" or any other desired type.


Note: a combination of "Standalone DLL" profile + "VCL Forms application" hook will set the same options as "VCL Forms Application" profile. That's why you'll see "VCL Forms Application" instead of "Standalone DLL" in "Application type" option when you open project settings next time. That's totally expected behavior. You can also initially only switch profile to "VCL Forms Application" and do nothing else - that's because this profile will set dialogs and turn on hooks for VCL.


The code for both DLL and exe remain unchanged from previous example. Run application and hit the buttons. You should see the same behavior and dialogs as in previous example.


Note that even if visual appearance seems the same - the internals are working differently now. DLL now has its own exception tracer. _ExceptionManagerHandle function will just invoke ExceptionManager.Handle in DLL. It will not try to communicate with exe host.



See also:

Send feedback... Build date: 2018-11-26
Last edited: 2018-06-14
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: