COM Clients and Servers

A critical part of COM is how clients and servers interact. A COM server is any object that provides services to clients. These services are in the form of implementations of COM interfaces that can be called by any client who is able to get a pointer to one of the interfaces on the server object. There are two main types of servers, in-process and out-of-process. In-process servers are implemented in a dynamic linked library (DLL), and out-of-process servers are implemented in an EXE file. Out-of-process servers can reside either on the local machine or on a remote machine. In addition, COM provides a mechanism that allows an in-process server (a DLL) to run in a surrogate EXE process to gain its advantages, such as being able to run the process on a remote machine. For more information, see DLL Surrogates.

A COM client is whatever code or object gets a pointer to a COM server, and uses its services by calling the methods of its interfaces.

The COM programming model and constructs have now been extended so that COM clients and servers can work together across the network, not just within a given machine. This has been done so existing applications can interact with new applications and with each other across networks with proper administration, while new applications can be written to take advantage of networking features.

In addition, client applications do not need to be aware of how server objects are packaged, whether they are packaged as in-process objects (in dynamic-link libraries), or as local or remote objects (in executables). Distributed COM further allows objects to be packaged as Windows NT Services, synchronizing COM with the rich administrative and system-integration capabilities of Windows NT.

Note  Throughout this documentation the acronym "COM" is used in preference to a special call-out of "DCOM". This is because DCOM is not separate – it is just COM with a longer wire. In cases where what is being described is specifically remote operation, the term distributed COM is used.

Also introduced are new features that complement existing COM features with the security required to build distributed component software. For more information, refer to Security in COM.

COM was designed from the beginning to make it possible to add the support for location transparency that extends across a network. It now allows applications written for single machines to run across a network, while features have been added that extend these capabilities and add the security necessary in a network.

COM specifies a mechanism by which the class code can be used by many different applications.

For information on how COM enables client/server interaction, see the following: