View Classes (Architecture)

 

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 View Classes (Architecture).

CView` and its derived classes are child windows that represent the client area of a frame window. Views show data and accept input for a document.

A view class is associated with a document class and a frame window class using a document-template object.

CView
The base class for application-specific views of a document's data. Views display data and accept user input to edit or select the data. Derive your view class(es) from CView.

CScrollView
The base class for views with scrolling capabilities. Derive your view class from CScrollView for automatic scrolling.

Form and Record Views

Form views are also scrolling views. They are based on a dialog box template.

Record views are derived from form views. In addition to the dialog box template, they also have a connection to a database.

CFormView
A scroll view whose layout is defined in a dialog box template. Derive a class from CFormView to implement a user interface based on a dialog box template.

CDaoRecordView
Provides a form view directly connected to a Data Access Object (DAO) recordset object. Like all form views, a CDaoRecordView is based on a dialog box template.

CHtmlView
Supports a control for Web browsing within an application. The control supports dynamic HTML in MFC.

COLEDBRecordView
Provides MFC OLE DB support for form views.

CRecordView
Provides a form view directly connected to an Open Database Connectivity (ODBC) recordset object. Like all form views, a CRecordView is based on a dialog box template.

Control Views

Control views display a control as their view.

CCtrlView
The base class for all views associated with Windows controls. The views based on controls are described below.

CEditView
A view that contains a Windows standard edit control (see CEdit). Edit controls support text editing, searching, replacing, and scrolling capabilities.

CRichEditView
A view that contains a Windows rich edit control (see CRichEditCtrl). In addition to the capabilities of an edit control, rich edit controls support fonts, colors, paragraph formatting, and embedded OLE objects.

CListView
A view that contains a Windows list control (see CListCtrl). A list control displays icons and strings in a manner similar to the right pane of File Explorer.

CTreeView
A view that contains a Windows tree control (see CTreeCtrl). A tree control displays icons and strings arranged in a hierarchy in a manner similar to the left pane of File Explorer.

See Also

Class Overview