- Table of Contents
- Copyright
- About the Authors
- About the Contributors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- How to Use This Book
- What You Need to Use This Book
- What's New in Visual C++ 6.0
- Contacting the Main Author
- Part I: Introduction
- Chapter 1. The Visual C++ 6.0 Environment
- Part II: MFC Programming
- Chapter 2. MFC Class Library Overview
- Chapter 3. MFC Message Handling Mechanism
- Chapter 4. The Document View Architecture
- Chapter 5. Creating and Using Dialog Boxes
- Chapter 6. Working with Device Contexts and GDI Objects
- Chapter 7. Creating and Using Property Sheets
- Chapter 8. Working with the File System
- Chapter 9. Using Serialization with File and Archive Objects
- Part III: Internet Programming with MFC
- Chapter 10. MFC and the Internet Server API (ISAPI)
- Chapter 11. The WinInet API
- Chapter 12. MFC HTML Support
- Part IV: Advanced Programming Topics
- Chapter 13. Using the Standard C++ Library
- Chapter 14. Error Detection and Exception Handling Techniques
- Chapter 15. Debugging and Profiling Strategies
- Chapter 16. Multithreading
- Chapter 17. Using Scripting and Other Tools to Automate the Visual C++ IDE
- Part V: Database Programming
- Chapter 18. Creating Custom AppWizards
- Chapter 19. Database Overview
- Chapter 20. ODBC Programming
- Chapter 21. MFC Database Classes
- Chapter 22. Using OLE DB
- Chapter 23. Programming with ADO
- Part VI: MFC Support for COM and ActiveX
- Chapter 24. Overview of COM and Active Technologies
- Chapter 25. Active Documents
- Chapter 26. Active Containers
- Chapter 27. Active Servers
- Chapter 28. ActiveX Controls
- Part VII: Using the Active Template Library
- Chapter 29. ATL Architecture
- Chapter 30. Creating COM Objects Using ATL
- Chapter 31. Creating ActiveX Controls Using ATL
- Chapter 32. Using ATL to Create MTS and COM+ Components
- Part VIII: Finishing Touches
- Chapter 33. Adding Windows Help
- Part IX: Appendix
ClassWizard
In developing C++ applications, you will do a lot of work with your own classes. Develo per Studio provides you with the ClassWizard to help in organizing your classes and integrating your classes with Windows. ClassWizard may be started from the View menu or by pressing Ctrl+W. The ClassWizard dialog box is made up of several different tabs, or pages, each of which allows you to work with different aspects of your classes. We will look at each of these tabs in the following sections.
Message Maps
The Message Maps page allows you to work with assigning message handlers to Win dows messages that your application will receive. This is really the heart of programming in the Windows event-driven programming model. The Message Maps tab is shown in Figure 1.20.
Figure 1.20 Class Wizard—Message Maps.
We will look at the specifics of using Class Wizard to work with message maps in Chapter 3, "MFC Message Handling Mechanism."
Member Variables
The Member Variables page, shown in Figure 1.21, is used to create member variables of your class that will be used to work with controls in dialog boxes. Unfortunately, it does not allow you to work with more general sorts of member variables.
Figure 1.21 Class Wizard—Member Variables.
Automation
The Automation tab, shown in Figure 1.22, helps you work with the methods and properties associated with classes that use Automation.
Figure 1.22 Class Wizard—Automation.
ActiveX Events
The ActiveX Events tab, shown in Figure 1.23, allows you to easily manage the ActiveX events that are supported by your ActiveX classes.
Figure 1.23 Class Wizard—ActiveX Events.
Class Info
The Class Info tab, shown in Figure 1.24, will show you some general information about your classes, including the header and source files that it is defined in, as well as its base class and any resource associated with it.
Figure 1.24 Class Wizard—Class Info.
Adding a Class
The Add Class button provides a quick and easy way to create a new class in your project. The New Class dialog box, which is presented when you choose New, allows you to choose the name for your new class and the base class that it derives from. You may select the file to create the class in and specify a particular resource that should be associated with the class. If the base class you choose can support Automation, you may specify options. The new class can also be automatically added to the Component Gallery.
In addition, you may choose the From a Type Library option when adding a new class. This will allow you to create classes based on an existing COM type library.
Component Gallery | Next Section

Account Sign In
View your cart