One of the problems we're going to have is keeping track of two sets of terminology. You're probably already familiar with C++ and some Object Oriented terminology. This table provides a rough equivalency between COM and conventional terminology.
Concept Conventional (C++/OOP) COM
Client A program that request services from a server. A program that calls COM methods.
Server A program that "serves" other programs. A program that makes COM objects available to a COM
client.
Interface None. A pointer to a group of functions that are called through
COM.
Class A data type. Defines a group of methods and data that are used
together.
The definition of an object that implements one or more
COM interfaces. Also, "coclass".
Object An instance of a class. The instance of a coclass.
Marshalling None. Moving data between client and server.
You'll notice the concepts of Interface and Marshalling don't translate well into the C++ model. The closest thing to an interface in C++ is the
export definitions of a DLL. DLL's do many of the same things as COM when dealing with a tightly coupled (in-process) COM server. Marshalling
in C++ is almost entirely manual. If you're trying to copy data between processes and computers, you'll have to write the code using some
sort of inter-process communication. You have several choices, including sockets, the clipboard, and mailslots.
0 comments:
Post a Comment