System.Win.ComObj.TAutoIntfObject.SafeCallException
Delphi
function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult; override;
C++
virtual HRESULT __fastcall SafeCallException(System::TObject* ExceptObject, void * ExceptAddr);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Win.ComObj.pas System.Win.ComObj.hpp |
System.Win.ComObj | TAutoIntfObject |
Description
SafeCallException is used for OLE exception handling.
SafeCallException prevents an exception from escaping its scope. Any exceptions raised must also be handled within the method.
The implementation of a safecall method guarantees that no exceptions escape by enclosing the body of the method in an implied exception block.
Note: SafeCallException calls the global routine HandleSafeCallException, which provides a standard way of handling this behavior. Methods of a CoClass that supports OLE exception handling (that implements the ISupportErrorInfo interface) are affected by this function. If those CoClass methods use the safecall calling convention, they are modified to return an HRESULT. Procedures will return an HRESULT, and functions will pass their usual result value as the last (out) parameter, and will return an HRESULT instead. The method is enclosed in an exception block, after which the HRESULT is returned, and the environment is set up so that the ISupportErrorInfo implementation will work correctly.