Name
ExceptObjProc Variable
Syntax
var ExceptObjProc: Pointer; functionExceptProc(var Rec: TExceptionRecord): TObject; begin ... end; ... ExceptObjProc := @ExceptProc;
Description
When a Windows exception occurs, Delphi calls the procedure
ExceptObjProc points to (if the variable is not
nil). The ExceptObjProc
function returns a new exception object that corresponds to the
Windows exception. If ExceptObjProc is
nil or if it returns nil,
Delphi lets the Windows exception terminate the application.
The sole argument to the ExceptObjProc function is
a pointer to an exception record.
Tips and Tricks
The
Windowsunit defines theTExceptionRecordtype. See the Windows Platform SDK documentation to learn about this record.The
SysUtilsunit setsExceptObjProcto a function that maps all the Windows exceptions to appropriate Delphi exceptions, e.g.,Status_Integer_Overflowbecomes anEIntOverflowobject.
Example
// Call the ExceptClsProc procedure to get the exception class,
// then create and return the exception object.
function CustomExceptObjFunc(var Rec: TExceptionRecord): TObject;
begin
Result := CustomExceptClsFunc(Rec).Create;
end;
ExceptObjProc := @CustomExceptObjFunc;See Also
| ExceptClsProc Variable, ExceptProc Variable, TExceptionRecord Type |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access