From RAD Studio API Documentation
Jump to: navigation, search


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


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


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