add application version to the report

delphi package - automated exception handling
Post Reply
emailaya
Posts: 249
Joined: Thu Oct 13, 2005 11:33 am
Contact:

add application version to the report

Post by emailaya »

hi

how can i add application version into the report?

thanks
kaju74
Posts: 24
Joined: Thu Nov 18, 2004 1:48 pm

Post by kaju74 »

Take a look at my topic

viewtopic.php?t=731
emailaya
Posts: 249
Joined: Thu Oct 13, 2005 11:33 am
Contact:

Post by emailaya »

i saw this post
but didnt really understand where exactly did u write this code
the advantage of madExcept is that u dont need to write any code...
its not even a component with events :)
kaju74
Posts: 24
Joined: Thu Nov 18, 2004 1:48 pm

Post by kaju74 »

...except if you want to add additional informations!

Add the following line to a unit which will be loaded very first in your app:

Code: Select all

initialization
  RegisterExceptionHandler(ExceptionFilter, stDontSync);
Now, write the code for "ExceptionFilter" somewhere in this unit:

Code: Select all

procedure ExceptionFilter(const exceptIntf : IMEException; var Handled : Boolean);
begin
  BugReportHeader['application version'] := VarContainsAppVersion;
end;
The code to retrieve the appversion should be included by yourself. If you don't know, just reply and I'll copy you the code snippet.
emailaya
Posts: 249
Joined: Thu Oct 13, 2005 11:33 am
Contact:

Post by emailaya »

ok
10x allot :)

i will try it

i know how to get the file version, 10x :)
emailaya
Posts: 249
Joined: Thu Oct 13, 2005 11:33 am
Contact:

Post by emailaya »

i added what u said
and got the following when building the project:

access violation in:
madExcept_wizard.bpl

and:
[Error] Main.pas(3654): Undeclared identifier: 'IMEException'
[Error] Main.pas(3656): Undeclared identifier: 'BugReportHeader'
[Error] Main.pas(3664): Undeclared identifier: 'RegisterExceptionHandler'
[Error] Main.pas(3664): Not enough actual parameters
kaju74
Posts: 24
Joined: Thu Nov 18, 2004 1:48 pm

Post by kaju74 »

are you sure you:

a) using madExcept3
b) included "madExcept" to the "uses"

???
emailaya
Posts: 249
Joined: Thu Oct 13, 2005 11:33 am
Contact:

Post by emailaya »

yes and yes
i restarted delphi
i keep getting the access violation during building of the app

only now, i get this error:
[Error] Main.pas(3656): Undeclared identifier: 'BugReportHeader'
kaju74
Posts: 24
Joined: Thu Nov 18, 2004 1:48 pm

Post by kaju74 »

:blush: My failure:

Code: Select all

procedure ExceptionFilter(const exceptIntf : IMEException; var Handled : Boolean); 
begin 
  with exceptIntf do
    BugReportHeader['application version'] := VarContainsAppVersion; 
end; 
Plz install the latest beta of ME3!
emailaya
Posts: 249
Joined: Thu Oct 13, 2005 11:33 am
Contact:

Post by emailaya »

i prefer not to install a beta
if it works, along with the access violation error
i'll keep the version i have
emailaya
Posts: 249
Joined: Thu Oct 13, 2005 11:33 am
Contact:

Post by emailaya »

ok it works
10x allot :)
Post Reply