Visual C++ 6 Unleashed

Visual C++ 6 Unleashed

By MICKEY WILLIAMS and David Bennett

Component Gallery

Object-oriented programming is intended to promote the reuse of existing software components. To make it even easier to reuse your classes, Developer Studio provides the Component Gallery, which allows you to insert many predefined classes into your project and also provides a handy way to catalog and store your own classes for use in other projects. To start the Component Gallery, as shown in Figure 1.25, choose Components and Controls from the Project, Add to Project menu.

01fig25.gif

Figure 1.25 The Components Gallery.

The components included in the gallery are organized in a directory tree structure. When you first install Visual C++ 6.0, you will see Visual C++ Components, which contains standard Visual C++ components, and Registered ActiveX Controls, which contain any ActiveX controls registered on your machine as top-level directories. You may also add your own controls in their own directory structures. After you open one of these folders, you will see a list of available components, as shown in Figure 1.26.

01fig26.gif

Figure 1.26 Visual C++ components.

The predefined components in Component Gallery can be used to add a wide variety of functionality to your applications, ranging from simple controls that can be used in dialog boxes, to ActiveX controls that can add some very complex capabilities to your application with a minimum of effort. Some of the components, such as palette support, add support for functions simply by providing handlers for a few messages.

Many of the components in the gallery might seem a bit cryptic at first glance, but there is a good deal of help available. When you select a component, a short description will appear next in the dialog box. If you click on the More Info button, you will see a much more detailed description of the component. Note that this help is available only if it has been entered by whoever created the component. Most of the predefined components include help, but you might consider adding help for your own components so that others can more easily reuse them.

Share ThisShare This

Informit Network