Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
MFC
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

CDHtmlDialog::GetElementInterface 

Retrieves the requested interface pointer from the HTML element identified by szElementId.


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

Parameters

szElementId

The ID of an HTML element.

ppvObj

Address of a pointer that will be filled with the requested interface pointer if the element is found and the query succeeds.

riid

The interface ID (IID) of the requested interface.

A standard HRESULT value.

CComPtr<IHTMLButtonElement> spBtn;
HRESULT hr = S_OK;

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

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

Community Additions

ADD
Show:
© 2015 Microsoft