mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 22:09:28 +02:00
MG: added ExceptProc to forms.pp
git-svn-id: trunk@380 -
This commit is contained in:
parent
90519840bf
commit
0c36e4eab1
21
lcl/forms.pp
21
lcl/forms.pp
@ -23,8 +23,6 @@
|
||||
***************************************************************************/
|
||||
}
|
||||
|
||||
|
||||
|
||||
unit Forms;
|
||||
|
||||
|
||||
@ -257,8 +255,6 @@ type
|
||||
procedure Idle;
|
||||
procedure MouseIdle(const CurrentControl: TControl);
|
||||
procedure SetIcon(AValue: TIcon);
|
||||
|
||||
procedure ExceptionOccurred(Sender : TObject; Addr,Frame : Pointer);
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -317,10 +313,23 @@ implementation
|
||||
|
||||
|
||||
uses
|
||||
buttons,stdctrls,interfaces,lresources {,designer};
|
||||
Buttons, StdCtrls, Interfaces, LResources {,designer};
|
||||
|
||||
const
|
||||
FocusMessages : Boolean = true;
|
||||
|
||||
|
||||
procedure ExceptionOccurred(Sender : TObject; Addr,Frame : Pointer);
|
||||
var
|
||||
FocusMessages : Boolean; //Should set it to TRUE by defualt but fpc does not handle that yet.
|
||||
Mess : String;
|
||||
Begin
|
||||
Mess := 'Error occurred at '#13#10'Address '+HexStr(Cardinal(Addr),8);
|
||||
if Application<>nil then
|
||||
Application.MessageBox('Exception',PChar(Mess),mb_IconError+mb_Ok)
|
||||
else
|
||||
writeln(Mess);
|
||||
end;
|
||||
|
||||
|
||||
function KeysToShiftState(Keys:Word): TShiftState;
|
||||
begin
|
||||
|
@ -2,6 +2,7 @@
|
||||
TApplication
|
||||
******************************************************************************)
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TApplication Constructor }
|
||||
{------------------------------------------------------------------------------}
|
||||
@ -16,7 +17,7 @@ begin
|
||||
FIcon := nil;
|
||||
|
||||
inherited Create(AOwner);
|
||||
// RaiseProc := @ExceptionOccurred;
|
||||
ExceptProc := @ExceptionOccurred;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
@ -298,18 +299,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TApplication.ExceptionOccurred(Sender : TObject; Addr,Frame : Pointer);
|
||||
var
|
||||
Mess : String;
|
||||
Begin
|
||||
Mess := 'Error occurred at '#13#10'Address '+inttostr(longint(addr));
|
||||
MessageBox('Exception',pchar(Mess),mb_IconError+mb_Ok);
|
||||
end;
|
||||
|
||||
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.10 2001/10/31 22:12:12 lazarus
|
||||
MG: added ExceptProc to forms.pp
|
||||
|
||||
Revision 1.9 2001/10/31 21:43:29 lazarus
|
||||
Added code for TApplication to get it ready to accept exceptions.
|
||||
Shane
|
||||
|
Loading…
Reference in New Issue
Block a user