Microsoft Visual Studio 6.0 provides developers a rich, visual environment, known as the integrated development environment (IDE). A common IDE is shared by Visual C++, Microsoft Visual J++, and Microsoft Visual InterDev, and it can host projects created with these tools as well as other types of files.
In this lesson, you will examine some of the features of the Visual C++ development environment typically used in the course of developing applications.
After this lesson, you will be able to:Estimated lesson time: 30 minutes
- Understand the elements of the Visual C++ user interface, including its windows, menus, and toolbars, and how they can be configured and customized.
- Get help from within the development environment.
- Change the project configuration settings.
- Build the MyApp project.
Figure 2.11 shows the MyApp project workspace as it was at the end of Lesson 1. It is divided into two main areas: the workspace window and the edit window.
Figure 2.11 Features of the Visual C++ user interface
The workspace window uses hierarchical tree controls to display a graphical view of the objects in your workspace. As you saw in Lesson 1, the projects in the workspace form the root items of this hierarchy. The workspace window offers three different views of the contents of your project, which are accessed by the three tabs along the bottom of the window:
Right-clicking an object in any of the views will bring up a shortcut menu with a set of object-related options.
The edit window is the area in which you work on open files, either with the program editor or one of the resource editors. If you would like more space while editing, click the Full Screen command on the View menu.
The Visual C++ development environment provides you with a complete set of menus that enable you to manage files and project workspaces, configure the environment, and access the help system, source control, and other external tools. Most of the menus have corresponding toolbars that allow you to select options with a single button click. Toolbars in Visual C++ are fully configurable. You can specify which toolbars are displayed and which buttons are included on a toolbar. This means that you can configure your environment so that your most commonly used options are easily accessible.
A new installation of Visual C++ shows the three most commonly used toolbars. The Standard toolbar, which contains the most frequently used commands for working with files; the Build MiniBar, which contains the most frequently used commands for building and running applications; and the WizardBar, which provides commands for working with classes.
Right-clicking an empty area of any of the toolbars or the main window frame will show you a list of available toolbars and will allow you to toggle their display status on or off.
The following exercises will demonstrate how you can customize your user interface and will provide you with a means to turn a full-screen edit window on or off with a single mouse click or keystroke.
Figure 2.12 The Commands tag of the Customize dialog box
NOTE
While the Customize dialog box is open, you can delete buttons from toolbars by right-clicking them and choosing Delete from the shortcut menu. You can also delete buttons by simply dragging them off the toolbar you want to remove them from and dropping them anywhere but on another toolbar.
Figure 2.13 Assigning a shortcut key
Display the Options dialog box (Figure 2.14) by clicking Options on the Tools menu. This tabbed page allows you to configure the design environment options for your installation of Visual C++. These options affect the appearance and behavior of the integrated tools that make up the development environment and apply to all projects and configurations of project settings.
Figure 2.14 The Options dialog box
The Options dialog box can be used to configure:
Visual Studio 6.0 ships with its own release of the Microsoft Developer Network (MSDN) library. This is an essential reference for developers, containing more than a gigabyte of technical programming information, including documentation, technical articles, sample code, the Microsoft Knowledge Base, and anything else you might need to develop solutions using Microsoft technology.
The MSDN library runs in its own HTML-based environment, complete with a fast, intelligent search engine. It is integrated with the Visual C++ development environment so that context-sensitive help is always available from within the Text editor (and from the output windows) simply by pressing F1.
Microsoft has provided further assistance in the form of context-sensitive Automatic Statement Completion. This feature, also known as IntelliSense, puts the MFC, Win32, and ATL libraries at your fingertips by displaying class members, function prototypes, identifier declarations, and code comments at the insertion point while you're editing your code. IntelliSense instantly shows all the available options. IntelliSense also optionally completes recognized words for you, saving you from continually having to type lengthy class or member names.
Display the Project Settings dialog box, shown in Figure 2.15, by clicking Settings on the Project menu. This dialog box is used to configure a wide range of options for the project, including options for compilers and the linker used by Visual C++.
Figure 2.15 The Project Settings dialog box
Changes made to any settings on any of the tabbed pages apply only to the currently selected project and the build version specified in the Settings For list. Each build type of each project has its own combination of settings. To maintain the same settings for all build versions of a project, select All Configurations in the Settings For list. When changing project settings, be careful to check the build version you are modifying. It is easy to apply settings to the wrong build version if you aren't careful.
When editing settings at the project level, the current project should be selected in the tree view in the left pane. You can move through the project's category folders and the individual files in the category folders. The settings available to you on the property sheets in the dialog box will correspond to the object that you selected in the tree. A common setting that occurs at file or folder level is the exclusion of a particular file, or set of files, from a build.
The Debug, C/C++, and Link tabs actually contain several pages of settings within a single page. To switch between these different groups of settings, select one of the options from the Category list on each page.
Some of the options you can set using the Project Settings dialog box are:
Now that you have a better understanding of the working environment, you are going to build the MyApp application from the project you created in Lesson 1.
TIP
When you are working with multiple projects and configurations, consider using the full Build toolbar rather than the Build MiniBar. The Build toolbar contains drop-down list box controls that allow you to switch between projects or configurations quickly and easily. These controls also remind you which project or configuration you are currently working on.
or
On the Build MiniBar (shown in Figure 2.16), click Build
or
Press F7.
Figure 2.16 The Build button on the Build Minibar
The program will compile and link, and the MyApp.exe file will be generated in the Debug directory.
or
On the Build MiniBar, click the Execute Program button (the red exclamation mark that is two buttons to the right of the Build button)
or
Press CTRL+F5.
Notice that the output window appears at the bottom of the screen. The output window contains a number of views that are accessible by clicking the tabs at the bottom. The appropriate view is generally displayed automatically according to what kind of output is being generated by the environment. As the build process runs, the Build tab displays messages from the compiler and linker.
Visual Studio 6.0 provides a rich, visual environment for developers, known as the integrated development environment, or IDE.
A new installation of Visual C++ will arrange a project for you. Along with the menus and toolbars, the user interface is organized into three main areas: the workspace window, the edit window, and the output window. The workspace window offers three different views of the contents of your project. ClassView presents an object-oriented view in terms of the C++ classes, their data members, and their member functions. ResourceView displays resource objects grouped by category. FileView presents a view of all the editable files in your project.
Visual C++ provides a wide range of toolbars that you can hide, show, and configure according to your needs. You can configure toolbars using the Customize command on the Tools menu.
Visual C++ provides a fully configurable environment. You can configure the environmental options for your installation of Visual C++ using the Options command on the Tools menu.
Visual Studio 6.0 ships with its own release of the MSDN library, an essential reference for developers.
Visual C++ provides a central location for configuring project settings. You can use the Project Settings dialog box to configure the options for the compilers and the linker used by Visual C++. You can specify any number of different configurations of project settings.