System.SafeCallErrorProc

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

SafeCallErrorProc: TSafeCallErrorProc; { Safecall error handler }

C++

extern DELPHI_PACKAGE TSafeCallErrorProc SafeCallErrorProc;

Properties

Type Visibility Source Unit Parent
variable public
System.pas
System.hpp
System System

Description

SafeCallErrorProc defines a procedure that is called when a safecall routine incurs an error.

A function or procedure defined with the safecall directive is invoked using a safe calling convention. When such a routine incurs an error, the SafeCallException is invoked. However, you can override this call by defining your own handling routine and setting SafeCallErrorProc to point to it.

SafeCallErrorProc should point to a procedure that takes two parameters:

  • ErrorCode is an integer holding the error code.
  • ErrorAddr is the code address at the time of error.

If SafeCallErrorProc returns normally or is set to nil, then the ESafecallException is raised.

See Also