Precompiled Header Files

Chapter 24 - Application and Class Wizards

Visual C++ 6: The Complete Reference
Chris H. Pappas and William H. Murray, III
  Copyright 1998 The McGraw-Hill Companies

Chapter 24: Application and Class Wizards
Overview
In the previous four chapters, you learned how to develop 32-bit Windows 95, 98, and NT applications with a procedure-oriented and object-oriented approach using Microsoft Foundation Class libraries. These chapters relied heavily on the use of templates for code development. Templates allow programmers to use redundant code over and over again, freeing them to concentrate on the new features of a particular application. We view these as static templates that you merely reuse from one application to another.
Sometimes, however, static templates are not enough. Imagine an application where you want to incorporate file I/O capabilities, such as creating a new file, opening an existing file, saving a file, and so forth. Perhaps you’ll also want to include editing capabilities, such as cutting, copying, pasting, and so on. Features such as these use a familiar menu style already incorporated in our static templates. Now extend your thinking a little farther and imagine creating applications with a multiple document interface (MDI) and object linking and embedding (OLE) features. No single static template will allow us to pick and choose from this extended list of programming features.
Microsoft’s solution was to create a dynamic template generator called the AppWizard. The AppWizard depends heavily on the Microsoft Foundation Class library and generates object-oriented code. To select the AppWizard, when starting a new project, select the File menu in the Visual C++ compiler. Then choose New and select the MFC AppWizard from the list of options. The AppWizard generates a code template that will allow you to select only those features you need for your application. However, as was the case with the static templates in this book, it is still up to you to write the remainder of the code for your unique application.
A close relative of the AppWizard is the ClassWizard. The ClassWizard allows you to add classes or customize existing classes. The ClassWizard can be used after the template code is created by the AppWizard. The ClassWizard is selected using the View menu and selecting the ClassWizard menu item.
This chapter will explore the use of these two wizards and help you understand how they can be put to work for you. Two applications will be developed as examples. The first will use the bare minimum AppWizard code to create an application with a client area that contains simple graphics. The second will use several wizard features. This application will be a simple text editor that can work with multiple documents (MDI), display a toolbar at the top of the application, and incorporate file I/O and editing capabilities.
Be warned, however, that there is a learning curve that you must overcome before you will become comfortable using these new tools. We strongly recommend that you review Chapters 22 and 23 before proceeding. These chapters deal with the MFC library. Wizards only generate object-oriented code; they rely on the MFC library for their power.

Books24x7.com, Inc 2000 –  


Visual C++ 6(c) The Complete Reference
Visual Studio 6: The Complete Reference
ISBN: B00007FYGA
EAN: N/A
Year: 1998
Pages: 207

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net