madExcept Plugins 

www.madshi.net

There are multiple ways to add custom data to the bug report created by madExcept:

1. First of all you can change madExcept.pas, which is not recommended, though, because you would have to do that again and again, everytime a new madExcept version is released.
2. If you think that you found a good addition to the bug report, which might be useful for the majority of madExcept users, you can contact me. I might consider to add it to the madExcept code base. But please be aware that I have to find a good balance between footprint and fany features.
3. You can register a little exception handler, e.g. by using RegisterExceptionHandler. In your handler you can then add your custom information to the bug report. This works just fine. Using this method has one disadvantage, though: You have to manually add code to each of your projects. And sharing your solution with other madExcept users is not that easy, either.

4. If you want to extend the bug report in a multitude of projects, or/and if you want to share your idea with other madExcept users, you should consider creating a madExcept plugin.

Creating a madExcept plugin is quite easy. Just write a function which returns a string, put this function in a seperate unit and call RegisterBugReportPlugin in the initialization. Finally rename the unit from "pas" to "mep" (for madExcept plugin). That's it. Here's a little example:

unit madExamplePlugin;

interface

// you have to put the function into the interface part, too
function GetExampleData : string;

implementation

uses madExcept;

function GetExampleData : string;
begin
  result := 'some text...';
end;

initialization
  RegisterBugReportPlugin('example', 'just a little example plugin', GetExampleData);
finalization
  UnregisterBugReportPlugin('example');  
end.

If you have written such a plugin, installing it is straightforward: Simply double click the "mep" file and the plugin is automatically installed into every Delphi version installed on your PC. You can even install a plugin while the Delphi IDE is running - the madExcept settings dialog will show the new plugin without needing a restart of the IDE. Can it be any easier?

Here's the definition of the register/unregister functions. If you set "ownSection" to "true", your text is put into a seperate section. Line breaks are allowed in that case. If you set "ownSection" to "false", your text is added the bug report header, instead. No line breaks in that case, please.

type
  // this is how your plugin main function has to look like
  TBugReportPlugin   = function : string;
  TBugReportPluginEx = function (const exceptIntf: IMEException) : string;

procedure RegisterBugReportPlugin (name        : string;
                                   description : string;
                                   proc        : TBugReportPlugin;
                                   ownSection  : boolean = true    ); overload;
procedure RegisterBugReportPlugin (name        : string;
                                   description : string;
                                   proc        : TBugReportPluginEx;
                                   ownSection  : boolean = true    ); overload;

procedure UnregisterBugReportPlugin (name: string);