Game Development Reference
COM Callable Wrappers (CCW)
The Component Object Model is a binary format that represents reusable objects
with a model that can be used from any programming language that can interface
with COM. When a COM client asks for an instance of an object, the server will
instantiate that object and return a reference to the client. COM acts as a binary
contract between the caller and callee, defined in a document called a Type library
(.tlb). This library document describes the services that are exposed to clients from
Figure 32.1 describes the communication between a client and a COM component.
Figure 32.1 Communication between a client and a COM component.
Figure 32.1 is meant to provide a high-level overview of communication. Methods specific to the
COM mechanism, such as AddRef , QueryInterface , and Release , are not shown because we
do not need to directly invoke them in this chapter.
COM components communicate with clients through a set of common interfaces,
while .NET communicates with components directly through assembly metadata
in the objects. This object-based communication is not understandable by COM
applications, so a mechanism known as a COM Callable Wrapper (CCW) can be
used to wrap .NET components so that they are accessible by COM and legacy
applications. Creating a CCW is covered later in this chapter.
Figure 32.2 shows communication between a client and a .NET object through a
COM Callable Wrapper.