- 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
Evolving OLE with Active Technologies
The introduction of Active Technologies has extended many of the original OLE technologies beyond the bounds of the local machine to Enterprise Wide networks and the Internet. Specifically, the following Active Technologies have their roots in OLE:
- Active documents, an extension of OLE documents
- Active controls, an extension to OLE controls
- Internet monikers, which extend traditional monikers
This is not the total effect of the introduction of Active Technologies. Elements of OLE are also present in new Active technologies, as you will see in the next section, "New Active Technologies." For now, let's concentrate on the evolution of OLE into Active Technologies.
Active Documents
Active Technologies extends OLE documents so that they can be used in Internet and corporate intranet settings. This technology is a way for existing OLE documents, such as Microsoft Word, Microsoft Project, and Microsoft PowerPoint, to be activated by a Web browser and brought up through a viewer. Thus, you can have compound files with various data that can contain linked and embedded objects being accessed across the World Wide Web (WWW). Using the ActiveX Hyperlinks technology, you can extend OLE documents across the Web. ActiveX hyperlinks are discussed in the next section.
Asynchronous Storage
The ability to bring Active documents across the WWW gives rise to another new Active technology, asynchronous storage. Basically, this extends Structured Storage across the Web, allowing for the storage to happen asynchronously. Obviously, with the slow bandwidth of the Internet, if you allowed a storage operation to happen synchronously, nothing else could happen on the client or server until the transfer of data to or from Persistent Storage took place. Using ActiveX hyperlinks and the technology of asynchronous monikers, asynchronous storage is accomplished.
ActiveX Controls
ActiveX controls are simply OLE controls or OCXs that have been extended to make them easier to deploy and use, especially in a network setting. Microsoft has now replaced the term OLE control with ActiveX control. Remember, COM and OLE are extendible architectures; therefore, these reusable components cannot only be embedded in a Web page, but also in a non–Internet-enabled application.
ActiveX controls can be created in a variety of languages, including C, C++, Java, and Visual Basic. They can also be manipulated though scripting languages such as VBScript or JavaScript.
ActiveX controls are great components; they provide a virtual plethora of little pockets of prefabricated functionality of which you can take advantage. The possibilities for ActiveX controls are endless. Currently, ActiveX controls range from a Calendar control to a Picture control, which enables you to display static pictures.
COM is at the base of the ActiveX control technology. ActiveX controls are built on a series of OLE services, with COM as the base. The following list depicts the technologies that you may find in a typical ActiveX control:
- Component object model
- Connectable objects
- Uniform Data Transfer (UDT)
- OLE documents
- Property pages
- Persistent storage
- OLE automation
ActiveX Control: COM
Like the OLE controls previously discussed, ActiveX controls are COM objects. They are in-process COM servers activated from the inside out. Like every other COM object, they expose the IUnknown interface so that container applications can access their properties and methods through the pointers returned by the interface.
ActiveX Control: Connectable Objects
Using a mechanism known as connection points, ActiveX controls support two-way communication from the control to the client application. Objects that use connection points are known as connectable objects. It enables the control to notify the client of events or invoke a method or event. It also enables the client to communicate directly with the control.
ActiveX Control: Uniform Data Transfer
Controls can be dragged and dropped within their client application if that functionality is enabled in the client application.
ActiveX Control: Compound Documents
In the beginning of this chapter, you saw how an object from another application could be embedded in a host application. In addition, that object could be activated in-place for visual editing. Likewise, ActiveX controls are built on the concept of OLE documents and can be activated in-place.
ActiveX Control: Property Pages
ActiveX controls have property pages, like their predecessor OLE controls, that expose their properties and methods to the user. From the property pages, the properties can be set.
ActiveX Control: Automation
ActiveX controls are usually Automation servers. Their properties and methods can be set at compile time through the use of property pages, and at runtime through VBScript and JavaScript.
ActiveX Control: Persistent Storage
COM objects can use Persistent Storage in a variety of ways. ActiveX controls use Persistent Storage to store their state. This enables the control to be initialized to the state it was when you last used it.
COM
As you learned previously, COM is a binary standard for objects. Basically, COM operates the way it did before ActiveX, except that COM has been extended so that you can exchange and use objects across the Internet. This has given rise to Distributed COM.
Distributed COM (DCOM)
Distributed COM, also known as DCOM, is the basic extension of binary COM objects across LANs, WANs, and the Internet. Now you can instantiate and bind objects across a network.
Internet Monikers
With the advent of ActiveX and the extension of COM across the net, monikers were also extended and incorporated into this architecture. This gave rise to two new types of monikers:
- URL monikers
- Asynchronous monikers
URL Monikers
A URL is a universal resource locator, used for Web-based addressing of objects. As you learned earlier, monikers are an intelligent naming system, so that by using the IMoniker interface to a moniker object and the intelligent name, you can locate the object. This capability was simply extended to include URLs, because of the capability of passing objects across the Internet and intranets.
Asynchronous Monikers
Previously, monikers carried out their binding to the object synchronously. Nothing could happen until the binding was complete. On the high latency, slow-link communications network of the Internet, holding up operations while binding is accomplished is unacceptable. With asynchronous monikers, the interfaces to the object negotiate the transmission of the binding process, to perform it asynchronously. Right now, URL monikers are the only standard implementation of asynchronous monikers.
New Active Technologies | Next Section

Account Sign In
View your cart