Soap.SOAPHTTPClient.THTTPRIO.QueryInterface

De RAD Studio API Documentation
Aller à : navigation, rechercher

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);

Propriétés

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

Description

Implémente la méthode IInterface QueryInterface.

QueryInterface est appelée via l'interface IInterface afin d'obtenir un pointeur d'interface pour l'interface identifiée par le paramètre IID. Dans Delphi, cet appel est généré lorsqu'une application transtype THTTPRIO en une interface invocable en utilisant l'opérateur as.

THTTPRIO ne peut renvoyer qu'un seul type de pointeur d'interface. Lorsqu'une application appelle QueryInterfacepour la première fois, THTTPRIO génère une table de méthodes en mémoire pour prendre en charge les appels aux méthodes sur l'interface demandée.

IID indique l'interface invocable que l'application souhaite appeler en utilisant cette instance de THTTPRIO. Si l'objet THTTPRIO a déjà été transtypé en une interface, IID doit identifier celle-ci. Si l'instance de THTTPRIO n'a pas encore été transtypée en une interface, IID doit être une interface invocable recensée.

Obj renvoie un pointeur pour l'interface spécifiée, sauf si THTTPRIO a déjà implémenté une autre interface ou si IID a identifié une interface qui n'a pas été recensée.

QueryInterface renvoie 0 (S_OK) si Obj renvoie un pointeur d'interface. Sinon, elle renvoie E_NOINTERFACE.

Remarque :  Dans C++, une seconde syntaxe modélisée prend une variable qui est une enveloppe DelphiInterface pour le type d'interface que vous souhaitez.

Si QueryInterface parvient à renvoyer un pointeur d'interface, elle incrémente automatiquement le compteur de références.

Voir aussi