- 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
- Just What Is an Active Document Container?
- Some Details About Active Document Containers
- The COM Interfaces
- Building an Active Document Container
- Summary
- 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
Just What Is an Active Document Container?
What an exciting industry to work in! Just when you think you have it all figured out, it seems as though everything changes. It wasn't that long ago when Microsoft was all jazzed about compound documents—the capability for the user to combine graphics, text, and data in one document. Now, with ActiveX and other Active technologies, it appears as though this has all gone away and everything is suddenly enabled for the Internet and intranets! Not to worry: Everything you know about OLE technology still applies. It's just been extended to cover new opportunities. As this chapter unfolds, you will see how existing OLE container support has been enhanced with new COM interfaces and how MFCs have been extended to support these interfaces. If you're new to COM, OLE, and ActiveX, you're in the right place. You'll find all the information you need to understand how active document containers work.
So what is an active document container? The short answer is that an active document container is an OLE container with some new COM interfaces—in particular, IOleCommandTarget, IOleDocumentSite, and IContinueCallback. These new interfaces have been added to support corresponding new interfaces in active documents. These interfaces first appeared in the Microsoft Office Binder application. Binder, as well as Internet Explorer, are active document containers. Active documents differ from OLE embedded documents in that they occupy the entire client area of the container and control more of the menu. To the user, the active document container appears to be the native application frame window. If you create a new Binder document and insert a Word document, an Excel spreadsheet, or a PowerPoint presentation, you notice that as you click each component of the binder that the user interface changes and the menus and toolbars appear as they would in the native application. This capability of the container to take on the appearance of any native application is what active document containers are all about. They allow the Binder application to bind together several applications into one file, and they enable Internet Explorer to download and display any active document data from a Web server.
Let's explore these new interfaces further. The IOleCommandTarget interface allows menu commands or other actions to be routed from the active document to the active document container. A corresponding IOleCommandTarget interface is defined for the active document. This corresponding interface allows the container to route menu commands and other actions to the document. This allows a bi-directional communication of commands to flow cooperatively between container and document. The effect to the user is that the container and document behave as a unified application. The user is unable to tell which piece of software supplies support for which menu item. Supporting the IOleCommandTarget interface is optional.
The IOleDocumentSite COM interface provides one method: ActivateMe, which allows the document server to ask the container to activate the document as a full active document instead of an OLE in-place embedded object.
The IContinueCallback COM interface provides printing support. It is used with the IPrint COM interface that the active document server exposes. The document server uses this interface to provide progress information to the container and to give the container the opportunity to cancel the printing operation.
Some Details About Active Document Containers | Next Section

Account Sign In
View your cart