- 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
The Workspace Window
When you open a project workspace you should see the Workspace window. If you do not, it was hidden the last time the workspace was open and can be brought to the foreground by selecting the Workspace command from the View menu or simply by pressing Alt+0. This window provides a roadmap to your projects that allows you to quickly navigate to where you need to go to do the real work of developing your application. You will notice that there are three tabs on the bottom of the window that allow you to view different sorts of information about your projects.
The FileView
You will notice immediately that the FileView will let you view the list of files in your projects, hence the name. What might not be quite so obvious is the fact that it provides a great deal of functionality designed to help you manage your files and projects. Although many workspaces include only a single project, you will see later that you can add any number of projects to a workspace. The FileView will display each project as a different top-level folder that can be expanded just like any other tree control in Windows. The FileView window for the HiMom example is shown in Figure 1.3.
Figure 1.3 FileView for the HiMom example.
Any files that you create within Developer Studio will be automatically added to your project, so you need to be concerned only with adding files that you have created yourself, outside of Developer Studio. This can include documentation or existing source files that you want to manage as part of your project.
Note that you should not include any of the standard libraries in your project. You should, however, include any libraries that will be built by your project so that the build process can check to see if that library should be rebuilt in order to bring the project up-to-date. Libraries to be included in a project may be specified in the Link tab of the Project Settings dialog box (from the Project, Settingsmenu command).
FileView allows you to drag and drop files to add them to your project or to move or copy them between your projects. If you want to delete a file from your project, simply select the file and press the Delete key. This will not actually delete the file, but will remove it from your project.
FileView will show an icon next to each filename. These icons can give you additional information about the file. For instance, if the icon has a down arrow on it, this file will be used in building the current configuration. In addition, certain add-on products may alter these icons. For example, if you have a source code control system installed, the icon might have a checkmark to denote that you have the file checked out.
You can open a file for editing by double-clicking it. You can also bring up a context menu by right-clicking the file. This gives you several other options, depending on the type of file you selected. Any version of the context menu will allow you to go to the Project Settings dialog box by selecting the Settings command.
The context menu will allow you to view a file's Properties dialog box, which is different for different file types, but will generally list information about the file, its inputs, outputs, and dependencies. This can be useful in making sure that the files in your project are being put together the way they should.
For source files, the context menu will give you the option to compile that file. Similarly, the context menu for a project will allow you to build the project. You can also use the Set as Active Project command to set it as the default project. For workspaces that contain more than one project, the active project is used whenever you build, execute, or debug.
You may also delete any intermediate files in a project by choosing the Clean command from the project's context menu. This is particularly useful when you see the amount of disk space that even simple projects consume.
The ClassView
As the name suggests, the ClassView displays a tree view of the classes that you have created for your project and allows you to expand the classes to reveal their member functions and variables. The ClassView for the HiMom application is shown in Figure 1.4.
Figure 1.4 ClassView for HiMom project.
You will notice that each of the class members has one or more icons to the left of it; these give useful information about the member type (data or function) and access class. (Protected members have a key, private members have a padlock, and public members have no access icon.)
You can directly access the source code for your classes by double-clicking the object that you are interested in. Double-clicking a class will immediately open the header file for the class and position the cursor at the start of the class declaration, and double- clicking a member variable will position the cursor on the declaration of the member variable. Double-clicking a member function will take you straight to the function definition, or implementation.
The context menu for a class allows several different choices for you to jump to the more powerful source code browser to examine how a class is used, including direct access to the definitions and references for the class, as well as lists of any base classes and derived classes associated with this class.
The context menu also allows a quick way to add member functions or variables by way of a simple dialog box, shown in Figure 1.5.
Figure 1.5 Add Member Function dialog box.
Project Configurations | Next Section

Account Sign In
View your cart