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