From Appmethod Libraries
Jump to: navigation, search

Object Pascal

SafeCallErrorProc: TSafeCallErrorProc; { Safecall error handler }


extern DELPHI_PACKAGE TSafeCallErrorProc SafeCallErrorProc;


Type Visibility Source Unit Parent
variable public
System System


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