Understanding the AppWizard and ClassWizard in Visual C++ Version 6.x by Marshall Brain

Introduction to the AppWizard, ClassWizard and the Resource Editors

The Visual C++ development environment comes with three different tools that can tremendously accelerate your software development cycle: The AppWizard, the ClassWizard and the resource editors. The latter is a collection of editors that you use individually to edit specific resource types. This tutorial will introduce you to these tools in a general way.

The AppWizard is a "template generator." Think about what you normally do when you begin any new project. Typically you would find some piece of code that you know works, and then you would strip out all of the things that you do not need from the old application. Then you would add in all of the functionality for the new application. The AppWizard saves you the first step. It generates a clean code template for you to use as the starting point for any new application that you want to create. The AppWizard gives you a number of different options as you are creating the template, and you choose among these options depending on what type of application you are planning to create. You will use the AppWizard exactly once for each application you create. After it has generated the template, the AppWizard is finished.

The template, or framework, that the AppWizard generates is an extremely complete MFC application consisting of twenty or so different files. See tutorial 3 for a description of these different files.

The ClassWizard is a tool that you can use to perform specific modifications to an AppWizard framework. In particular, you will most often use the ClassWizard to modify message maps, to generate new classes derived from existing MFC classes, and to add member variables to certain classes. The ClassWizard can also perform several other tasks related to OLE automation code and OCX code. The ClassWizard is only useful if you are working within a framework generated by the AppWizard.

Resources are user interface objects that you can create with visual resource editors. Resources include bitmaps, cursors, dialogs, icons, menus and their accelerator table, string tables and version information. Although you could do what resources do with normal MFC code (for example, you could hand-code a menu or a dialog using normal MFC code written in C++), resources are generally much easier to create and apply in a program. Therefore, the use of resources speeds your application development cycle. Resources have the added advantage of concentrating language-specific parts of your user interface in a specific place that is completely separate from your C++ code. So, for example, you can create an English, French and Spanish version of your resources and, without changing any of your C++ code, easily create three different versions of your application in three different languages.

When you are creating applications using these tools, you will typically start by creating the application's initial framework with the AppWizard. The framework will include all of the normal menu options like File Open, Edit Cut/Copy/Paste, and the Help menu. You will then use the Resource Editors to add new menu items, dialogs, etc. to your application. You will use the Class Wizard to modify message maps, override virtual functions, add new classes, and so on to the application. Because these tools do so much of the grunt work for you, they significantly increase your development speed and reduce the number of errors you make.