madExcept Settings (runtime)
|
|
|
|
Most madExcept settings can be configured at runtime, too. For that
purpose there are a number of interfaces available. The settings are
splitted into two main interfaces. The first one is named "IMESettings", the
second one "IMEModuleSettings". The latter is a descendant of the first one.
Why two interfaces instead of one? The reason is that you can adjust some
settings on a per exception case, while others can only be adjusted
globally. The exception interface IMEException is a descendent of the
"IMESettings" interface. So all settings contained in the "IMESettings"
interface can be adjusted locally for one specific exception. The settings
which are only adjustable globally are contained in the "IMEModuleSettings"
interface.
There are two different ways to change settings. First of all if an
exception occurs, you can change settings for that exception simply by
accessing the settings properties of the IMEException interface. The
other way is to grab the "IMEModuleSettings" interface of a specific module
(dll/exe/bpl). You can do that by using one of the overloaded "MESettings"
functions.
 |
type
IMESettings = interface ['{27DBC590-890F-463E-8D05-32E33584119F}'];
IMEModuleSettings = interface (IMESettings) ['{E2196B25-D73A-4F69-B79B-D65539763B31}'];
function MESettings : IMEModuleSettings; overload;
function MESettings (module : dword ) : IMEModuleSettings; overload;
function MESettings (addr : pointer) : IMEModuleSettings; overload;
function IMESettings. Module : dword;
function IMEModuleSettings. IsValid : boolean;
function IMEModuleSettings. Enabled : boolean;
MESettings(GetModuleHandle('kernel32.dll')).IsValid -> false
|
|
Let's go through the settings properties in the same way the
settings dialog
is set up. The first tab contains the
basic settings. These can't be adjusted
at runtime through the settings interfaces. You can control the freeze check
behaviour by using some global madExcept functions, though. E.g. have
a look at PauseFreezeCheck, SetFreezeTimeout and
ImNotFrozen.
 |
function IMEModuleSettings. LinkInSettings : boolean;
function IMEModuleSettings. LinkInMapFile : boolean;
function IMEModuleSettings. CheckFileCrc : boolean;
function IMEModuleSettings. CheckForFreeze : boolean;
function IMEModuleSettings. FreezeTimeout : dword;
property IMEModuleSettings. WindowsLogo : boolean;
function IMEModuleSettings. ReportLeaks : boolean;
function IMEModuleSettings. CrashOnOverrun : boolean;
function IMEModuleSettings. CrashOnUnderrun : boolean;
|
|
Let's continue with the second tab of
the settings dialog:
 |
property IMESettings. AutoSave : boolean;
property IMESettings. AutoSaveIfNotSent : boolean;
property IMESettings. AutoSend : boolean;
property IMESettings. AutoSendPrgrBox : boolean;
property IMESettings. AutoClipboard : boolean;
property IMESettings. SuspendThreads : boolean;
property IMESettings. ShowPleaseWaitBox : boolean;
property IMESettings. AutoContinue : boolean;
property IMESettings. AutoRestart : dword;
property IMESettings. AutoClose : dword;
property IMESettings. AutoDelay : dword;
|
|
Now let's have a look at the third tab
of the settings dialog. The settings on
this tab are only adjustable globally.
 |
property IMEModuleSettings. Filter1Classes : string;
property IMEModuleSettings. Filter2Classes : string;
property IMEModuleSettings. Filter1NoBugReport : boolean;
property IMEModuleSettings. Filter2NoBugReport : boolean;
property IMEModuleSettings. GeneralNoBugReport : boolean;
property IMEModuleSettings. Filter1NoScreenShot : boolean;
property IMEModuleSettings. Filter2NoScreenShot : boolean;
property IMEModuleSettings. GeneralNoScreenShot : boolean;
property IMEModuleSettings. Filter1NoSuspend : boolean;
property IMEModuleSettings. Filter2NoSuspend : boolean;
property IMEModuleSettings. GeneralNoSuspend : boolean;
property IMEModuleSettings. Filter1NoHandlers : boolean;
property IMEModuleSettings. Filter2NoHandlers : boolean;
property IMEModuleSettings. GeneralNoHandlers : boolean;
type
TMEShowSetting = (ssFullBox, ssAssistant, ssDetailBox, ssSimpleBox, ssNothing);
property IMEModuleSettings. Filter1ShowSetting : TMEShowSetting;
property IMEModuleSettings. Filter2ShowSetting : TMEShowSetting;
property IMEModuleSettings. GeneralShowSetting : TMEShowSetting;
property IMEModuleSettings. Filter1Assistant : string;
property IMEModuleSettings. Filter2Assistant : string;
property IMEModuleSettings. GeneralAssistant : string;
|
|
Next we have the forth tab of the
settings dialog.
 |
property IMESettings. SendBtnVisible : boolean;
property IMESettings. SaveBtnVisible : boolean;
property IMESettings. PrintBtnVisible : boolean;
property IMESettings. ShowBtnVisible : boolean;
property IMESettings. ContinueBtnVisible : boolean;
property IMESettings. RestartBtnVisible : boolean;
property IMESettings. CloseBtnVisible : boolean;
type
TMEButton = (bSendBugReport, bSaveBugReport, bPrintBugReport, bShowBugReport,
bContinueApplication, bRestartApplication, bCloseApplication);
property IMESettings. FocusedButton : TMEButton;
property IMESettings. SendAssistant : string;
property IMESettings. SaveAssistant : string;
property IMESettings. PrintAssistant : string;
property IMESettings. AutoShowBugReport : boolean;
property IMESettings. NoOwnerDrawButtons : boolean;
|
|
Here comes the fifth tab:
 |
property IMESettings. SendInBackground : boolean;
property IMESettings. MailAddr : string;
property IMESettings. UploadToFogBugz : boolean;
property IMESettings. UploadToBugZilla : boolean;
property IMESettings. UploadToMantis : boolean;
property IMESettings. UploadToCustomScript : boolean;
property IMESettings. HttpServer : string;
property IMESettings. HttpSsl : boolean;
property IMESettings. HttpPort : dword;
property IMESettings. HttpAccount : string;
property IMESettings. HttpPassword : string;
property IMESettings. BugTrackerAccount : string;
property IMESettings. BugTrackerPassword : string;
property IMESettings. BugTrackerProject : string;
property IMESettings. BugTrackerArea : string;
property IMESettings. BugTrackerAssignTo : string;
property IMESettings. MailAsSmtpServer : boolean;
property IMESettings. MailAsSmtpClient : boolean;
property IMESettings. SmtpServer : string;
property IMESettings. SmtpSsl : boolean;
property IMESettings. SmtpTls : boolean;
property IMESettings. SmtpPort : dword;
property IMESettings. SmtpAccount : string;
property IMESettings. SmtpPassword : string;
property IMESettings. MailViaMapi : boolean;
property IMESettings. MailViaMailto : boolean;
property IMESettings. MailFrom : string;
property IMESettings. AdditionalFields : IMEFields;
|
|
On to the sixth tab:
 |
property IMESettings. AttachBugReport : boolean;
property IMESettings. AttachBugReportFile : boolean;
property IMESettings. DeleteBugReportFile : boolean;
property IMESettings. BugReportSendAs : string;
property IMESettings. BugReportZip : string;
property IMESettings. ScreenShotDepth : integer;
property IMESettings. ScreenShotAppOnly : boolean;
property IMESettings. ScreenShotSendAs : string;
property IMESettings. ScreenShotZip : string;
property IMESettings. AdditionalAttachments : IMEAttachments;
|
|
The next tab is the seventh:
 |
property IMESettings. BugReportFile : UnicodeString;
property IMESettings. AppendBugReports : boolean;
property IMESettings. BugReportFileSize : dword;
property IMESettings. NoDupExcepts : boolean;
property IMESettings. NoDupFreezes : boolean;
type
TMEDupDef = (ddExceptAddrIdentical, ddCrashStackIdentical, ddAllStacksIdentical);
property IMESettings. DupExceptDef : TMEDupDef;
property IMESettings. DupFreezeDef : TMEDupDef;
|
|
Let's move on to the eighth tab:
 |
property IMESettings. ListThreads : boolean;
property IMESettings. ShowCpuRegisters : boolean;
property IMESettings. ShowStackDump : boolean;
property IMESettings. ShowDisAsm : boolean;
property IMESettings. HideUglyItems : boolean;
property IMESettings. ShowRelativeAddrs : boolean;
property IMESettings. ShowRelativeLines : boolean;
property IMESettings. FormatDisassembly : boolean;
property IMESettings. LimitDisassembly : integer;
property IMESettings. PluginEnabled [plugin: string] : boolean;
function IMESettings. VersionVar : string;
|
|
The assistant creator tab is mainly
about design time configuration. At runtime the only thing you can do is
use the existing assistants.
 |
function IMESettings. GetAssistant (name: string) : INVAssistant;
|
|
Last but not least we have the tenth
tab:
 |
property IMESettings. TitleBar : string;
property IMESettings. ExceptMsg : string;
property IMESettings. FrozenMsg : string;
property IMESettings. BitFaultMsg : string;
property IMESettings. SendBtnCaption : string;
property IMESettings. SaveBtnCaption : string;
property IMESettings. PrintBtnCaption : string;
property IMESettings. ShowBtnCaption : string;
property IMESettings. ContinueBtnCaption : string;
property IMESettings. RestartBtnCaption : string;
property IMESettings. CloseBtnCaption : string;
property IMESettings. OkBtnCaption : string;
property IMESettings. DetailsBtnCaption : string;
property IMESettings. PleaseWaitTitle : string;
property IMESettings. PleaseWaitText : string;
property IMESettings. BugTrackerTitle : string;
property IMESettings. BugTrackerDescription : string;
property IMESettings. MailSubject : string;
property IMESettings. MailBody : string;
property IMESettings. SendBoxTitle : string;
property IMESettings. PrepareAttachMsg : string;
property IMESettings. MxLookupMsg : string;
property IMESettings. ConnectMsg : string;
property IMESettings. SendMailMsg : string;
property IMESettings. FieldsMsg : string;
property IMESettings. SendAttachMsg : string;
property IMESettings. SendFinalizeMsg : string;
property IMESettings. SendFailureMsg : string;
|
|
Sometimes when using 3rd party translation tools it makes sense to ask
madExcept to reload its settings at a specific point in time. You can do
so by calling the following method:
 |
procedure IMEModuleSettings. Reload;
|
|
When sending emails and when uploading via HTTP you can add custom
attachments, if you like. These attachments are managed through the
"IMEAttachments" interface:
 |
type
IMEAttachments = interface ['{7DE1DA9C-28D7-4527-954F-F951B88BEE41}'];
procedure IMEAttachments. Add (originalFile : UnicodeString;
sendAsFileName : string = '';
zipFile : string = '';
fieldName : string = '');
function IMEAttachments. Delete (originalFile: string) : boolean;
procedure IMEAttachments. Clear;
property IMEAttachments. ItemCount : integer;
function IMEAttachments. GetItem (index : integer;
var originalFile : UnicodeString;
var sendAsFileName : string;
var zipFile : string;
var fieldName : string) : boolean;
procedure IMEAttachments. Lock;
procedure IMEAttachments. Unlock;
function IMEAttachments. Clone : IMEAttachments;
MESettings.AdditionalAttachments.Add('c:\boot.ini');
exceptIntf.AdditionalAttachments.Add(ParamStr(0), '', 'crashingExe.zip');
|
|
When uploading a bug report via HTTP, you can add custom fields, if you
want. These custom fields are managed through the "IMEFields" interface.
The very same interface is also used for managing the bug report header and
the bug report sections.
 |
type
IMEFields = interface ['{AF0EA7A7-2B36-46FD-BF2E-245ABA2740E2}'];
procedure IMEFields. Add ( item, content: string);
procedure IMEFields. Insert (index: integer; item, content: string);
procedure IMEFields. Delete (index: integer); overload;
procedure IMEFields. Delete (item : string ); overload;
property IMEFields. ItemCount : integer;
property IMEFields. Items [index : integer] : string;
property IMEFields. Contents [item : string ] : string; default;
function IMEFields. FindItem (item : string ) : integer;
procedure IMEFields. Lock;
procedure IMEFields. Unlock;
function IMEFields. Clone : IMEFields;
MESettings.AdditionalFields['SomeField'] := 'SomeText';
exceptIntf.BugReportHeader['smiley'] := ':-)';
|
|