Mega Search
23.2 Million


Sign Up

Make a donation  
Translate EEFFACE exception into a meaningfull Exception  
News Group: borland.public.cppbuilder.language.cpp

My main program is written in Delphi, but I'm calling a DLL written in C++. 
My problem comes up when the C++ dll throws an exception and it isn't 
handled within the dll.  It then gets into Delphi's VCL and all I see is 
"EEFFACE Exception", with not other real message of what the exception 
actually was.  Is there any way to "translate" the exception being thrown in 
my C++ dll so that it's readable by Delphi.  I tried a standard EEFFACE 
exception translator, but it was too out of date and didn't work with 
BDS2006.

- Dan 


Vote for best question.
Score: 0  # Vote:  0
Date Posted: 3-Jan-2008, at 11:07 AM EST
From: Dan
 
Re: Translate EEFFACE exception into a meaningfull Exception  
News Group: borland.public.cppbuilder.language.cpp
"Remy Lebeau (TeamB)"  wrote in message 
news:477d45c8@newsgroups.borland.com...
>
> "Nicola Musatti"  wrote in message 
> news:477d2b49$1@newsgroups.borland.com...
>
>> I understand your reasoning about DLL's, but this is also the
>> behaviour you get when a C++ exceptions reaches the main
>> event loop in a BCB VCL application
>
> That is a different issue that doesn't involve exceptions passing the DLL 
> boundary, though.  Granted, it is still a C++ exception passing into a 
> Pascal RTL, but both are Borland environments and can be worked with, as 
> demonstrated by the article I linked to.  That is not a guarantee when 
> DLLs are involved, though.  Especially if the DLLs are written in 
> non-Borland compilers.
>
>> Dan, please consider voting for this QC report of mine: 
>> http://qc.codegear.com/wc/qcmain.aspx?d=10729
>
> Also mine:
>
>    Handle Uncaught C++ Exceptions more gracefully in Delphi RTL
>    http://qc.codegear.com/wc/qcmain.aspx?d=12740
>
>
> Gambit

I voted for Nicola's request but when I just tried to log in(to vote for 
Remy's), it gave me this error about unhandled exceptions "An unhandled 
exception occurred during the execution of the current web request. Please 
review the stack trace for more information about the error and where it 
originated in the code. "  Oh man the irony, I get an unhandled exception 
when I'm logging in to complain about one.  The error page looks terrible, 
too.

- Dan 


Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 3-Jan-2008, at 2:50 PM EST
From: Dan
 
Re: Translate EEFFACE exception into a meaningfull Exception  
News Group: borland.public.cppbuilder.language.cpp
"Nicola Musatti"  wrote in message 
news:477d2b49$1@newsgroups.borland.com...

> I understand your reasoning about DLL's, but this is also the
> behaviour you get when a C++ exceptions reaches the main
> event loop in a BCB VCL application

That is a different issue that doesn't involve exceptions passing the DLL 
boundary, though.  Granted, it is still a C++ exception passing into a 
Pascal RTL, but both are Borland environments and can be worked with, as 
demonstrated by the article I linked to.  That is not a guarantee when DLLs 
are involved, though.  Especially if the DLLs are written in non-Borland 
compilers.

> Dan, please consider voting for this QC report of mine: 
> http://qc.codegear.com/wc/qcmain.aspx?d=10729

Also mine:

    Handle Uncaught C++ Exceptions more gracefully in Delphi RTL
    http://qc.codegear.com/wc/qcmain.aspx?d=12740


Gambit 



Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 3-Jan-2008, at 12:28 PM EST
From: Remy Lebeau \(TeamB\)
 
Re: Translate EEFFACE exception into a meaningfull Exception  
News Group: borland.public.cppbuilder.language.cpp
Remy Lebeau (TeamB) wrote:
> "Dan"  wrote in message 
> news:477d244f$1@newsgroups.borland.com...
[...]
>> It then gets into Delphi's VCL and all I see is "EEFFACE Exception",
>> with not other real message of what the exception actually was.
> 
> That is because Delphi does not know how to interpret C++ exceptions.  Even 
> if it did, there is still no guarantee that it could be handled properly 
> anyway since exception handling is compiler-specific.

I understand your reasoning about DLL's, but this is also the behaviour 
you get when a C++ exceptions reaches the main event loop in a BCB VCL 
application and this a BCB shortcoming.

Dan, please consider voting for this QC report of mine: 
http://qc.codegear.com/wc/qcmain.aspx?d=10729

Cheers,
Nicola
-- 
Nicola Musatti
Team Browns
Home: http://nicola.musatti.googlepages.com/home
Blog: http://wthwdik.wordpress.com/

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 3-Jan-2008, at 7:36 PM EST
From: Nicola Musatti
 
Re: Translate EEFFACE exception into a meaningfull Exception  
News Group: borland.public.cppbuilder.language.cpp
"Dan"  wrote in message 
news:477d244f$1@newsgroups.borland.com...

> My main program is written in Delphi, but I'm calling a DLL
> written in C++. My problem comes up when the C++ dll
> throws an exception and it isn't handled within the dll.

DLLs are not supposed to allow exceptions to cross over the boundary into 
the application (and vice versa) for exactly this reason.  The two may be 
using completely different environments that do not know how to handle each 
other's exceptions.  The DLL is buggy if it does not follow that rule.

> It then gets into Delphi's VCL and all I see is "EEFFACE Exception",
> with not other real message of what the exception actually was.

That is because Delphi does not know how to interpret C++ exceptions.  Even 
if it did, there is still no guarantee that it could be handled properly 
anyway since exception handling is compiler-specific.

> Is there any way to "translate" the exception being thrown in my C++
> dll so that it's readable by Delphi.

Not reliably.  If you wrote the DLL yourself, or have its source code for 
recompiling, then you should change it to not ever allow exceptions to pass 
across the DLL boundary at all.

> I tried a standard EEFFACE exception translator, but it was too
> out of date and didn't work with BDS2006.

Is this the one you are referring to?

    http://www.respower.com/~earlye/programming/TranslateStandardExceptions.htm


Gambit 



Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 3-Jan-2008, at 10:21 AM EST
From: Remy Lebeau \(TeamB\)