PDA

View Full Version : EurekaLog 6.0.15 with BDS 2006 C++ Builder not catching ANY exceptions in DLL


Ken Schafer
15-Jul-2008, 11:26 PM
First thing; I'm using BDS 2006 C++ Builder *without* Final Builder and I'm
trying to create a DLL which uses EurekaLog. It all seems to load and
initialize correctly, but never catches any exceptions, neither showing the
EurekaLog dialog nor creating an .elf file.

I've created a small sample DLL which shows this problem. All it contains
is the framework code C++ Builder creates when you start a VCL DLL project.
In the main C++ dll entry I've added about 5 lines of code to produce a
division by zero error. In addition to the EurekaLog.pas file which
EurekaLog adds to the project, it also uses an additional Pascal file
(because I couldn't figure out how to call Pascal functions from a C++ file)
which calls the IsEurekaLogInstalled and IsEurekaLogActive functions during
the unit's initialization routine to verify that it is active and installed.
This happens before the DLL Main Entry point is hit.

I've also included a loader program which dynamically loads this library
when you click a button and then reports whether it loaded successfully.

It all functions as expected, except that when the division by zero error
happens no EurekaLog.

Any help you can give me would be GREATLY appreciated.

I've attached the source code for both this sample dll (exceptlog.bdsproj)
and the project (exceptloader.dpr) which loads it .

- Ken Schafer

admin
21-Jul-2008, 07:31 AM
Hi,

I'm just working on your demo from the past week.

Seems to be an hard problem to solve, so I must ask to you a bit more patient, please. ;-)

I hope to can tell you good news shortly! :)

admin
22-Jul-2008, 11:33 AM
Hi,

I have just released the 6.0.16 RC 2.

This release do not fix your issue because EurekaLog currently isn't able to trap DllMain exceptions (only on C++Builder) cause internal C++Builder implementation.

But with this new version we can try to create a little workaround to partially solve your issue.

Download this new version and after add your DllMain code into a try/catch block, calling EurekaLog with the StandardEurekaNotify(ExceptObject, ExceptAddr);

This only shows the DllMain source line not the source line of internal error, but also this is a C++Builder limits because it returns as last Exception Address and TObject nil and nil.

I hope to have helped you a bit more, don't hesitate to write to me for other feedback.