Condividi tramite


CDHtmlDialog::GetElementInterface

Recupera un puntatore a interfaccia richiesta dall'elemento HTML identificato da szElementId.

template <class Q>
HRESULT GetElementInterface(
   LPCTSTR szElementId,
   Q** ppvObj 
);
HRESULT GetElementInterface(
   LPCTSTR szElementId,
   REFIID riid,
   void** ppvObj 
);

Parametri

  • szElementId
    L'id di un elemento HTML.

  • ppvObj
    L'indirizzo di un puntatore che verrà riempita con un puntatore a interfaccia necessaria quando l'elemento viene trovato e la query ha esito positivo.

  • riid
    L'id di interfaccia (IID) dell'interfaccia richiesta.

Valore restituito

Un valore standard HRESULT.

Esempio

CComPtr<IHTMLInputButtonElement> spBtn1;
CComPtr<IHTMLInputButtonElement> spBtn2;
HRESULT hr = S_OK;

// Use the template overload
hr = GetElementInterface(L"Button1", &spBtn1);

// Use the nontemplate overload
hr = GetElementInterface(L"Button1", IID_IHTMLInputButtonElement, 
   reinterpret_cast<void**>(&spBtn2));

Requisiti

Header: afxdhtml.h

Vedere anche

Riferimenti

Classe di CDHtmlDialog

Grafico della gerarchia

CDHtmlDialog::GetElement

CDHtmlDialog::GetControlDispatch