On 12/24/09, JoshyFun <[email protected]> wrote:
> Can anybody tell me why this code does not raise an exception and
> silently kills the program ?
It actually does raise an exception.
b...@simenon:~/LazarusProjecten> ./leeg
[FORMS.PP] ExceptionOccurred
Sender=EFOpenError
Exception=Unable to open file "NonExistsFilename"
Stack trace:
$0808EAA8
$080877F1 UFRMMAIN_init, line 27 of ufrmmain.pas
$0806D2B4
TApplication.HandleException Unable to open file "NonExistsFilename"
Stack trace:
$0808EAA8
$080877F1 UFRMMAIN_init, line 27 of ufrmmain.pas
$0806D2B4
exception at 0808EAA8:
Unable to open file "NonExistsFilename".
Just run the program from commandline (in Windows uncheck Win32 GUI
application in Project -> Compiler Options -> Linking, or put
{$APPTYPE CONSOLE} at top of your .lpr file)
The unhandled exception is handled by the deafult exception handler,
which (I guess) at that point in time, is not the exception handler
that you expect (the fancy one showing the message with option
Continue/Terminate).
I think it all has to do with at what time which exceptionhandler is
initialised.
Bart
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus