System.Sensors.TCustomSensor.GetInterface

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetInterface(const IID: TGUID; out Obj): HResult;

C++

HIDESBASE HRESULT __fastcall GetInterface(const GUID &IID, /* out */ void *Obj);

Properties

Type Visibility Source Unit Parent
function public
System.Sensors.pas
System.Sensors.hpp
System.Sensors TCustomSensor

Description

Retrieves a specified interface.

System.Sensors.TCustomSensor.GetInterface inherits from System.TObject.GetInterface. All content below this line refers to System.TObject.GetInterface.

Retrieves a specified interface.

GetInterface retrieves the interface designated by a GUID or type name. The basic implementation of GetInterface uses the GUID specified in the IID parameter. If the specified interface is supported by the class, it is returned in the Obj parameter, and GetInterface has a return value of True. Otherwise, Obj contains nil (Delphi) or NULL (C++), and GetInterface returns False.

Note: In Delphi code, IID can be an interface name. The compiler automatically translates this name into the corresponding GUID.

Note: In C++ code, use the templated version of GetInterface to obtain an interface from a DelphiInterface object.

GetInterface is equivalent to the as operator (Delphi) and dynamic casts (C++), except that GetInterface does not raise an exception if the interface is not supported.

See Also