共用方式為


CHtmlEditView Class

 

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.

Syntax

class CHtmlEditView : public CHtmlView, public CHtmlEditCtrlBase<CHtmlEditView>  

Members

Public Constructors

Name Description
CHtmlEditView::CHtmlEditView Constructs a CHtmlEditView object.

Public Methods

Name Description
CHtmlEditView::Create Creates a new window object.
CHtmlEditView::GetDHtmlDocument Returns the IHTMLDocument2 interface on the current document.
CHtmlEditView::GetStartDocument Retrieves the name of the default document for this view.

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CView

CScrollView

CFormView

CHtmlEditCtrlBase

CHtmlView

CHtmlEditView

Requirements

Header: afxhtml.h

CHtmlEditView::CHtmlEditView

Constructs a CHtmlEditView object.

CHtmlEditView();

CHtmlEditView::Create

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

CHtmlEditView::GetDHtmlDocument

Returns the IHTMLDocument2 interface on the current document.

BOOL GetDHtmlDocument(IHTMLDocument2** ppDocument) const;  

Parameters

ppDocument
The IHTMLDocument2 interface.

CHtmlEditView::GetStartDocument

Retrieves the name of the default document for this view.

virtual LPCTSTR GetStartDocument();

See Also

HTMLEdit Sample
Hierarchy Chart