CHtmlEditView 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 CHtmlEditView Class.

Provides the functionality of the WebBrowser editing platform within the context of MFC's document/view architecture.

class CHtmlEditView : public CHtmlView, public CHtmlEditCtrlBase<CHtmlEditView>  

Public Constructors

NameDescription
CHtmlEditView::CHtmlEditViewConstructs a CHtmlEditView object.

Public Methods

NameDescription
CHtmlEditView::CreateCreates a new window object.
CHtmlEditView::GetDHtmlDocumentReturns the IHTMLDocument2 interface on the current document.
CHtmlEditView::GetStartDocumentRetrieves the name of the default document for this view.

CObject

CCmdTarget

CWnd

CView

CScrollView

CFormView

CHtmlEditCtrlBase

CHtmlView

CHtmlEditView

Header: afxhtml.h

Constructs a CHtmlEditView object.

CHtmlEditView();

Creates a new window object.

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

Parameters

lpszClassName
Points to a null-terminated character string that names the Windows class. The class name can be any name registered with the [AfxRegisterWndClass]--brokenlink--(../Topic/not%20found.md#afxregisterwndclass) global function or the RegisterClass Windows function. If NULL, uses the predefined default CFrameWnd attributes.

lpszWindowName
Points to a null-terminated character string that represents the window name.

dwStyle
Specifies the window style attributes. By default, the WS_VISIBLE and WS_CHILD Windows styles are set.

rect
A reference to a RECT structure specifying the size and position of the window. The rectDefault value allows Windows to specify the size and position of the new window.

pParentWnd
A pointer to the parent window of the control.

nID
The ID number of the view. By default, set to AFX_IDW_PANE_FIRST.

pContext
A pointer to a CCreateContext. NULL by default.

Remarks

This method will also call the contained WebBrowser's Navigate method to load a default document (see CHtmlEditView::GetStartDocument).

Returns the IHTMLDocument2 interface on the current document.

BOOL GetDHtmlDocument(IHTMLDocument2** ppDocument) const;  

Parameters

ppDocument
The IHTMLDocument2 interface.

Retrieves the name of the default document for this view.

virtual LPCTSTR GetStartDocument();

HTMLEdit Sample
Hierarchy Chart

Show: