IUnknown

This interface enables clients to get pointers to other interfaces on a specified object through the IUnknown::QueryInterface method, and manage the existence of the object through the IUnknown::AddRef and IUnknown::Release methods. All other COM interfaces are inherited, directly or indirectly, from IUnknown. Therefore, the three methods in IUnknown are the first entries in the Vtable for every interface.

At a Glance

Header file: Unknwn.h
Windows CE versions: 1.0 and later

Methods Description
IUnknown::QueryInterface Returns a pointer to a specified interface on an object to which a client currently holds an interface pointer. This method must call IUnknown::AddRef on the pointer it returns.
IUnknown::AddRef Increments the reference count for an interface on an object. It should be called for every new copy of a pointer to an interface on a specified object.
IUnknown::Release Decrements the reference count for the calling interface on a object. If the reference count on the object falls to 0, the object is freed from memory.