CHtmlEditCtrl Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CHtmlEditCtrl Class.

Provides the functionality of the WebBrowser ActiveX control in an MFC window.

class CHtmlEditCtrl: public CWnd,   
    public CHtmlEditCtrlBase<CHtmlEditCtrl>  

Public Constructors

NameDescription
CHtmlEditCtrl::CHtmlEditCtrlConstructs a CHtmlEditCtrl object.

Public Methods

NameDescription
CHtmlEditCtrl::CreateCreates a WebBrowser ActiveX control and attaches it to the CHtmlEditCtrl object. This function automatically puts the WebBrowser ActiveX control into edit mode.
CHtmlEditCtrl::GetDHtmlDocumentRetrieves the IHTMLDocument2 interface on the document currently loaded in the contained WebBrowser control.
CHtmlEditCtrl::GetStartDocumentRetrieves the URL to a default document to load in the contained WebBrowser control.

The hosted WebBrowser control is automatically put into edit mode after it is created.

CObject

CCmdTarget

CHtmlEditCtrlBase

CWnd

CHtmlEditCtrl

Header: afxhtml.h

Constructs a CHtmlEditCtrl object.

CHtmlEditCtrl();

Creates a WebBrowser ActiveX control and attaches it to the CHtmlEditCtrl object. The WebBrowser ActiveX control automatically navigates to a default document and then is placed in edit mode by this function.

virtual BOOL Create(
    LPCTSTR lpszWindowName,  
    DWORD dwStyle,  
    const RECT& rect,  
    CWnd* pParentWnd,  
    int nID,  
    CCreateContext* pContext = NULL);

Parameters

lpszWindowName
This parameter is unused.

dwStyle
This parameter is unused.

rect
Specifies the control's size and position.

pParentWnd
Specifies the control's parent window. It must not be NULL.

nID
Specifies the control's ID.

pContext
This parameter is unused.

Return Value

Returns TRUE on success, FALSE on failure.

Retrieves the IHTMLDocument2 interface on the document currently loaded in the contained WebBrowser control

BOOL GetDHtmlDocument(IHTMLDocument2** ppDocument) const;  

Parameters

ppDocument
The document interface.

Retrieves the URL to a default document to load in the contained WebBrowser control.

virtual LPCTSTR GetStartDocument();

Hierarchy Chart

Show: