Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part III: MFC’s Document-View Architectu... > Separating the Document from Its Vie...

Chapter 15. Separating the Document from Its View

Now you’ll finally get to see the interaction between documents and views. Chapter 12 gave you a preview of this interaction when it showed the routing of command messages to both view objects and document objects. In this chapter, you’ll see how the document maintains the application’s data and how the view presents the data to the user. You’ll also learn how the document and view objects talk to each other while the application executes.

The two examples in this chapter both use the CFormView class as the base class for their views. The first example is as simple as possible, with the document holding only one simple object of class CStudent, which represents a single student record. The view shows the student’s name and grade and allows editing. With the CStudent class, you’ll get some practice writing classes to represent real-world entities. You’ll also get to use the Microsoft Foundation Class (MFC) library diagnostic dump functions.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial