madExcept and Runtime Packages

delphi package - automated exception handling
Post Reply
jsantos98
Posts: 13
Joined: Fri Jun 03, 2005 1:21 am

madExcept and Runtime Packages

Post by jsantos98 »

Hello Mathias,

It took me some time, but I finally found out what was going on with my application when using madExcept and runtime Packages that was returning the ExceptObject as nil when an exception occurred.

So try this :

Create an application with runtime packages that has a button and an event handler for the madExcept.OnException whith some code like this :

procedure TForm1.MadExceptionHandler1Exception(
const exceptIntf: IMEException; var handled: Boolean);
begin
ShowMessage (exceptIntf.ExceptMessage);
Handled := True;
end;

Run it...

When the button is pressed, the exception is thrown and the messagebox shows it correctly
(Raise (Exception.Create ('This is a test!'));).


Now, do the following :

1. Copy the rtl70.bpl file to the same folder where the executable is.
2. UPX the rtl70.bpl file (this will only compress the bpl file).
(http://upx.sourceforge.net/)
3. Now, when you run again the file, it will show "Unknown." instead of the exception.

I have tried this and only madExcept had an odd behaviour when I compress the BPL files.


What can I do to solve this (beside not compressing the BPL file)?


Regards,

Joao Santos
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Ouch, UPXing the RTL... :shock:

I'll have a look at this.
jsantos98
Posts: 13
Joined: Fri Jun 03, 2005 1:21 am

Post by jsantos98 »

Hello Mathias,


Thanks!


I need to have the BPL files as small as possible... UPX is the only thisg I could do to acomplish that.


Regards,

Joao
Post Reply