The published COM specification mandates that COM objects must minimally implement the IUnknown interface. This interface comprises three functions - QueryInterface, AddRef and Release. Component Object Model (COM) is a Microsoft platform for software componentry introduced by Microsoft in 1993. ...
QueryInterface is used to obtain a pointer to another interface, given a GUID that uniquely identifies that interface (commonly known as an IID). If the COM object does not implement that interface, an error is returned instead.
AddRef is used by clients to indicate that a COM object is being referenced. This is necessary to ensure that a COM object is not disposed prematurely
Release is used by clients to indicate that they have finished using the COM object. An unreferenced COM object may be safely disposed.
The IUnknown interface is defined as a GUID with the value of {00000000-0000-0000-C0000-00000000046}. In computer science, a pointer is a programming language datatype whose value refers directly to (points to) another value stored elsewhere in the computer memory using its address. ... This article or section is in need of attention from an expert on the subject. ... This article or section is in need of attention from an expert on the subject. ...
Miscellanea
IUnknown as serves as the base for Core Foundation's CFPlugIn framework
Core Foundation (also called CF) is a Mac OS X framework and API. CF provides: Primitive types for data (raw bytes, Unicode strings, numbers, calendar dates, UUIDs) and collections (arrays, sets, dictionaries) Application preferences management (CFPropertyList, Preferences Utilities) XML parsing Bundle handling File system I/O (CFReadStream, CFWriteStream, CFURL) Network...
When all the clients using the COM object have released their references, the COM object removes itself from memory, and then unloads the associated library or application if it was the last object being used from that COM object provider.
IUnknown is the base interface in COM that every COM object must implement.
All COM interfaces extend IUnknown, have vtables that contain the three IUnknown methods in exactly the same vtable positions, and append their own methods to the base IUnknown vtable.