System.IInterface.QueryInterface

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;

Properties

Type Visibility Source Unit Parent
function public System.pas System IInterface

Description

Returns a reference to a specified interface if the object supports that interface.

QueryInterface checks whether the object that implements the IInterface interface supports the interface specified by IID. If so, QueryInterface:

  • Increments the reference count.
  • Sets the Obj parameter so that it points to an instance of the specified interface.
  • Returns S_OK (0) to indicate success.

If the object does not support the interface, QueryInterface returns a nonzero error code, such as E_NoInterface.

See Also