Visual C + +. NET Programming Lecture VII

Source: Internet
Author: User

Summary

The first introduction to MFC in the "one-file multiple view" mode, and for the viewer to add a view to display the Web page Cwebview, and then discuss two more common single document views of the switching method, and finally the two methods are analyzed and compared.

MFC "one file multiple view" mode

We know that MFC applications use a programming pattern that separates data in a program from its display and user interaction, which is the document/view architecture. In a single document application structure, a document corresponds to a view. However, sometimes a document may require multiple views to change the way document data is displayed, known as "Multiple view of a file", and MFC provides the following three modes for this "one-file multiple vision":

The first pattern is used in a multiple-document application, with the same view class to create multiple view objects and display them in their own windows. For example, when we select the "New Window" command on the Window menu, the program opens a new window that displays the same document content. As shown in the interface, there are multiple document windows in a frame window, as illustrated in Figure 1 (a).

The second pattern is the dynamic segmentation window, where multiple views are created in the same document window, and the same document content is displayed in the same way. As shown in Figure 1 (b).

The third pattern is the static splitting window, where multiple views are created in the same document window, but each view can display the contents of the document in different ways. As shown in Figure 1 (c).

(a)

(b)

(c)

Figure 1 Three modes of "one-file multi-View"

However, in this lecture, "One-click" refers to the characteristics of multiple views in a single document application. The document window has only one view at a time, but can be toggled through commands such as menus in multiple views. Our goal is to toggle the contents of the document between normal text and HTML browsing views, as shown in Figures 2 (a) and 2 (b).

(a)

(b)

Figure 2 Results of view switching

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.