- 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
What Is an ActiveX Control?
Now that you know a little of the history behind ActiveX controls, this section explores just what an ActiveX control is. An ActiveX control is an embeddable COM object that is implemented as an in-process server DLL. It supports in-place activation as an inside-out activated object. Objects that are activated inside-out become user interface active with a single mouse click, instead of the double-click required for OLE or Active document embedded objects.
As an in-process object, an ActiveX control is loaded into the address space of its container. As you probably are aware, most Win32 processes have a virtual 4GB address space. (The Datacenter version of Windows 2000 has a much larger address space.)
The lower 2GB is where the application is loaded, and the upper 2GB is reserved for use by the operating system. An ActiveX control is loaded in the lower 2GB with the application. Therefore, the control shares the same resources with the application; hence the term in-process.
An ActiveX control is also a server that establishes two-way communication between the control and its container. It also can respond to user-initiated events, such as mouse movements, keyboard input, and programmatic scripting input—and it can pass that input to the container application for action.
ActiveX controls also are in-place activated. This means they can be placed in the active state by the user or the container and edited or manipulated. This is a functionality ActiveX controls inherit from OLE documents. Like a DLL, the ActiveX control is a library of functions. In fact, an ActiveX control can be considered a "super DLL." More than just a "super DLL," an ActiveX control is a detached object that can fire and respond to events, process messages, contain unique properties, and possess multithreaded capabilities. ActiveX controls also are known as OCXs because of their most common file extension, but they are actually DLLs. OCXs can contain several controls.
An ActiveX control can have its own data set and can act as an automation server, enabling you to manipulate its properties and methods. ActiveX controls can be 16 and 32 bit as well as Unicode. ActiveX controls can have properties set at both compile time and runtime, and ActiveX controls have methods that can perform certain operations.
ActiveX controls cannot be executed without an ActiveX container. You can use ActiveX controls in a wide variety of development tools, such as Delphi, Visual C++, Borland C++, Visual Basic, and PowerBuilder. You also can use ActiveX controls in a variety of environments not traditionally associated with programming, such as Microsoft Word, Microsoft Excel, Lotus, Hypertext Markup Language (HTML), and Internet Explorer.
ActiveX Control Architecture | Next Section

Account Sign In
View your cart