System.IUnknown.QueryInterface

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

virtual HRESULT STDMETHODCALLTYPE QueryInterface(    /* [in] */ REFIID riid,
    /* [iid_is][out] */ __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject) = 0;
 
QueryInterface(Q** pp)

Properties

Type Visibility Source Unit Parent
function public
System.pas
unknwn.h
System IUnknown

Description

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

QueryInterface checks whether the object that implements this 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 0 to indicate success.

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

See Also

Personal tools
Translations