In addition to its simple About dialog box, which is handled the same way as in Hello, the Phone Book program requires five kinds of dialog boxes to get information from the user. Three of these are standard Windows dialog boxes and are not created with Microsoft Foundation Classes. These are discussed later, under “Standard Windows Dialog Boxes” on page 167. The other two, the Find and the Edit dialog boxes discussed below, are derived from one of the Microsoft Foundation dialog classes.
Because the Find and Edit dialog boxes contain additional controls, you can't simply construct a CModalDialog object, as in the About dialog box. Instead, you must derive a new dialog class from CModalDialog and provide it with code to process the controls. You'll derive two such classes, one for each of the two new kinds of dialog boxes needed for this program.
In this chapter, you'll begin creating two files, VIEW.H and VIEW.CPP. After you complete this chapter and the next, these files will contain the application class and the main window class, including its message map.
The complete code for files VIEW.H and VIEW.CPP is given in Listing 1 and Listing 2 at the end of the chapter.