4_f09_mfc_docview_580H - MFC Windows Programming:...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
MFC Windows Programming: Document/View Approach ? More detailed notes at: http://www.cs.binghamton.edu/~reckert/360/class15.htm MFC Windows Programming: App/Window vs. Document/View Approach ? An App/Window approach program creates application and window objects ? Mirrors Win32 API program organization ? Main difference--MFC automates and masks details … and does many other necessary tasks ? ? Frequently, data members exist in window class – Example in MSG2005.CPP: Output string defined in window-based class • But output string is data • Really has nothing to do with window it’s being displayed in
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
? Conceptually data is different from rendering of data ? In an App/Window approach program they are mixed together in same window class ? Frequently we need to have different views of same data – (e.g., displaying data in a window or on a printer) ? So it’s a good idea to separate data and data presentation Doc/View Achieves Separation of Data and Data Presentation ? Encapsulates data in a CDocument class object ? Encapsulates data display mechanism and user interaction with it in a CView class object ? Classes derived from CDocument – Should handle anything affecting an application's data ? Classes derived from CView – Should handle display of data and user interactions with that display
Background image of page 2
Other Classes are Still Needed ? Still need to create CFrameWnd and CWinApp classes ? But their roles are reduced Documents ? Document – Contain any forms of data associated with the application (pure data) – Not limited to text – Could be anything • game data, graphical data, etc.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
? Single Document interface ( SDI ) application – Program that deals with one document at a time – All our programs to date have been SDI apps ? Multiple Document Interface ( MDI ) application – Program organized to handle multiple documents simultaneously – More than one document can be displayed in a window at the same time – Example of an MDI application: Microsoft Excel Document Interfaces Views ? A rendering of a document; a physical representation of the data ? Provides mechanism for displaying data stored in a document ? Defines how data is to be displayed in a window ? Defines how the user can interact with it
Background image of page 4
Frame Window ? Window in which a view of a document is displayed ? A document can have multiple views associated with it – different ways of looking at the same data ? But a view has only one document associated with it
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MFC Template Class Object ? Handles coordination between documents, views, and frame windows ? In general: – Application object creates a template. .. – which coordinates display of document's data…
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/04/2009 for the course ER CS 360 taught by Professor Reckert during the Spring '09 term at Istanbul Technical University.

Page1 / 21

4_f09_mfc_docview_580H - MFC Windows Programming:...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online