Skip to content

Latest commit

 

History

History
73 lines (61 loc) · 2.94 KB

File metadata and controls

73 lines (61 loc) · 2.94 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision ms.author manager translation.priority.ht
Using Views
na
10/14/2016
visual-studio-dev14
na
na
devlang-cpp
na
article
C++
interacting with users and role of view class
drawing, data
rendering data
view classes, role in managing user interaction
CView class, view architecture
MFC, views
views, using
painting data
user input, interpreting through view class
view classes, role in displaying application data
dc3de6ad-5c64-4317-8f10-8bdcc38cdbd5
7
mblome
ghogen
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

Using Views

The view's responsibilities are to display the document's data graphically to the user and to accept and interpret user input as operations on the document. Your tasks in writing your view class are to:

  • Write your view class's OnDraw member function, which renders the document's data.

  • Connect appropriate Windows messages and user-interface objects such as menu items to message-handler member functions in the view class.

  • Implement those handlers to interpret user input.

In addition, you may need to override other CView member functions in your derived view class. In particular, you may want to override OnInitialUpdate to perform special initialization for the view and OnUpdate to do any special processing needed just before the view redraws itself. For multipage documents, you also must override OnPreparePrinting to initialize the Print dialog box with the number of pages to print and other information. For more information on overriding CView member functions, see class CView in the MFC Reference.

What do you want to know more about?

See Also

Document/View Architecture
CFormView Class
Record Views (MFC Data Access)
Bypassing the Serialization Mechanism