Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This interface enables clients to get pointers to other interfaces on a specified object through the IUnknown::QueryInterfacemethod, and manage the existence of the object through the IUnknown::AddRefand IUnknown::Releasemethods.

All other COM interfaces are inherited, directly or indirectly, from IUnknown.

Therefore, the three methods in IUnknownare the first entries in the vtable for every interface.

Methods

The following table shows the methods for this interface in alphabetical order.

Method Description

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::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::AddRefon the pointer it returns.

IUnknown::Release

Decrements the reference count for the calling interface on a object.

If the reference count on the object falls to zero, the object is freed from memory.

Remarks

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header unknwn.h, unknwn.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also