- 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
Active Servers Introduction
This chapter discusses the three types of COM, OLE, and Active servers.
First is the full server. A full server is both an OLE or Active document server and a fully functioning application. In Microsoft Word, for example, you can run the application (as I am doing while writing these words), create a document or brochure, and then save the contents to a .DOC file. Or, you can open an application such as WordPad and actually embed or link to content that you've created using Microsoft Word.
The second type of server is known as a miniserver. What this means is that the server can be used only to supply content for a container application. As an example, Microsoft Word comes with myriad applets that can help you produce professional-looking documents. One of these applets is Microsoft WordArt. If you attempt to run the WordArt program, you'll get a message telling you that the application can be run only when launched from inside another application.
Now, we'll veer off in a totally different direction and talk about the third type of server. This is where things get a bit confusing for some folks. The third type of server—automation server—doesn't necessarily act or appear to be anything like the full server or miniserver. In fact, a simple automation server doesn't support OLE or Active document embedding at all. Instead, this type of server exposes special objects, methods, and properties to enable you to tell it what to do. For example, suppose that I want to take a mail-merge document that I created in Microsoft Word and merge it with a mailing list stored in a Microsoft Access database. Sure, I could open up Microsoft Word and select the mail merge menu item (along with performing about half a dozen other steps) and manually achieve my goal. Or, I could write an application in Visual C++ (or any other language that supports automation) and remotely control Microsoft Word. That way, I could set up the program so that it runs every day at 4 a.m., unattended, for example.
There are two flavors of automation servers: in-process and out-of-process.
In a nutshell, an in-process server is created from a class stored in a DLL, which is loaded and runs in the same process space as the application that created it. All instances share the same code; however, each has its own independent data area.
An out-of-process server runs in its own address space. This type of server is built as an EXE application (such as for Microsoft Word and Excel) and can either manage multiple instances or launch a new copy of the EXE each time a server object is created.
Okay, I know, it's a lot to grasp right now. Don't worry, though, because by the time you get through this chapter, I'm sure you'll have a much better grasp of how these different types of servers work.
Three-Tier Development Using Server Components | Next Section

Account Sign In
View your cart