System.Win.ComObj.TComObject.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 | TComObject |
Description
Handles OLE exceptions.
SafeCallException prevents an exception from being raised to escape its scope. Any exceptions raised must also be handled within the method.
The implementation of a safecall method guarantees that no exceptions are raised by enclosing the statement part 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 a exception block, after which the HRESULT is returned, and the environment is set up so that the ISupportErrorInfo implementation will work correctly.