Redigera

Dela via


IUnknown interface (unknwn.h)

Enables clients to get pointers to other interfaces on a given object through the QueryInterface method, and manage the existence of the object through the AddRef and 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.

Methods

The IUnknown interface has these methods.

 
IUnknown::AddRef

Increments the reference count for an interface pointer to a COM object. You should call this method whenever you make a copy of an interface pointer.
IUnknown::QueryInterface

A helper function template that infers an interface identifier, and calls QueryInterface(REFIID,void).
IUnknown::QueryInterface

Retrieves pointers to the supported interfaces on an object.
IUnknown::Release

Decrements the reference count for an interface on a COM object.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header unknwn.h

See also

Using and Implementing IUnknown