- 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
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:
- Does the manufacturer supply the source code with the component, or does it offer a code-escrow service? The source code would come in handy if the manufacturer goes out of business or has a bug in its component that it is not going to fix.
- What are the licensing fees and distribution costs?
- Is the control Web-enabled?
- What kind of support and money-back guarantee does the manufacturer provide?
- What tools will the component be supported in?
- What kind of documentation, such as programmer manuals, help files, and installation guides, does the control come with?
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.
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.
Figure 28.13 The list of registered ActiveX controls in the Components and Controls Gallery dialog box.
Testing an ActiveX Control | Next Section

Account Sign In
View your cart