Visual C++ 6 Unleashed

Visual C++ 6 Unleashed

By MICKEY WILLIAMS and David Bennett

Reinventing the Wheel

In today's software development environment, software engineers not only are designers and programmers, but increasingly, software engineers are taking on the role of component integrators. End users demand that their software be developed quickly, be rich in features, and integrate with the rest of the software they use. With the advent of COM, Common Object Request Broker Architecture (CORBA), and JavaBeans, you now have hundreds of thousands of reusable components and objects to choose from. An abundance of DLLs, controls, automation components, and document objects are at your fingertips. ActiveX controls especially provide an off-the-shelf, self-contained, reusable package of functionality created by someone else. ActiveX controls provide functionality of all types, such as multimedia, communications, user-interface components, report writing, and computational.

The functionality offered by available ActiveX controls is functionality you do not have to create. The key to component integration is to be able to integrate all the components with a custom application so that they work in single harmonious union, as if they were native to the application.

Before you embark on creating this application, however, you should take care not to reinvent the wheel. ActiveX controls, the COM, and the object-oriented paradigm present a unique opportunity for you to truly have code reuse. To achieve this nirvana of code reuse, you should evaluate what components are already out there. Likewise, before you decide to write your own ActiveX controls, you should take a look at what is already out there and see whether you can use what is already available.

When you choose to use off-the-shelf components, you should consider a few things. You should ask the following questions:

These questions can save you a lot of heartache later. Integration of these off-the-shelf components sometimes is tricky. Make sure you thoroughly research the components you choose. To find some of these available off-the-shelf components, look in some of the computer industry trade magazines.

Visual C++ ActiveX Controls

Visual C++ 6.0 comes with a plethora of ActiveX controls. Therefore, before you take the time to create your own control, take a look around and see what is available. Take a look at all the ActiveX controls available to you from the Components and Controls Gallery in Visual C++. Choose Project, Add to Project, Components and Controls to invoke the Components and Controls Gallery dialog box, as shown in Figure 28.12.

28fig12.gif

Figure 28.12 The Components and Controls Gallery dialog box.

Click the Registered ActiveX Controls folder. Take a look at all of the ActiveX controls available, as shown in Figure 28.13.

28fig13.gif

Figure 28.13 The list of registered ActiveX controls in the Components and Controls Gallery dialog box.

Share ThisShare This

Informit Network