IUnknown

In programming, the IUnknown interface is the fundamental interface in the Component Object Model (COM). The published COM specification mandates that COM objects must minimally implement this interface. Furthermore, every other COM interface must be derived from IUnknown.

Contents

Methods

The IUnknown interface exposes three methods (sometimes called functions): QueryInterface, AddRef, and Release:[1]

interface IUnknown
{
   virtual HRESULT QueryInterface(REFIID riid, void **ppvObject) = 0;
   virtual ULONG AddRef(void) = 0;
   virtual ULONG Release(void) = 0;
};

The IUnknown interface ID is defined as a GUID with the value of {00000000-0000-0000-C000-000000000046}.

Miscellaneous

Notes

  1. ^ IUnknown definition at microsoft.com; accessed 18-Jan-2008
  2. ^ ActiveX Controls at microsoft.com; accessed 18-Jan-2008
  3. ^ Plug-ins at apple.com; accessed 18-Sept-2011
  4. ^ Charlie Kindel, Foreword to Don Box, Essential COM, p. xi

See also

Links