Soap.SOAPHTTPClient.THTTPRIO.QueryInterface

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

HRESULT __stdcall QueryInterface(::System::DelphiInterface<T>& smartIntf)
virtual HRESULT __stdcall QueryInterface(const GUID &IID, /* out */ void *Obj);

Properties

Type Visibility Source Unit Parent
function public
Soap.SOAPHTTPClient.pas
Soap.SOAPHTTPClient.hpp
Soap.SOAPHTTPClient THTTPRIO

Description

Implements the IInterface QueryInterface method.

QueryInterface is called through the IInterface interface to obtain an interface pointer for the interface identified by the IID parameter. In Delphi, this call is generated when an application casts THTTPRIO to an invokable interface using the as operator.

THTTPRIO can only return a single type of interface pointer. The first time an application calls QueryInterface, THTTPRIO generates an in-memory method table to support calls to the methods on the requested interface.

IID specifies the invokable interface that the application wants to call using this THTTPRIO instance. If the THTTPRIO object has already been typecast to an interface, then IID must identify that interface. If the THTTPRIO instance has not yet been typecast to an interface, then IID must be a registered invokable interface.

Obj returns an interface pointer for the specified interface, unless THTTPRIO was already implementing a different interface or IID identified an interface that was not registered.

QueryInterface returns 0 (S_OK) if Obj successfully returns an interface pointer. It returns E_NOINTERFACE otherwise.

Note: In C++, a second, templatized syntax takes a variable that is a DelphiInterface wrapper for the desired interface type.

If QueryInterface successfully returns an interface pointer, it automatically increments the reference count.

See Also