- IUnknown
In
programming , the IUnknown interface is the fundamental interface in theComponent Object Model (COM). The published [http://www.microsoft.com/com/resources/comdocs.asp COM specification] mandates that COM objects must minimally implement this interface. Furthermore, every other COM interface must be derived from IUnknown.Methods
The IUnknown interface exposes three methods (sometimes called functions):
QueryInterface
,AddRef
, andRelease
: [http://msdn2.microsoft.com/en-us/library/ms680509.aspx IUnknown definition] at [http://microsoft microsoft.com] ; accessed 18-Jan-2008]*
QueryInterface
is used to obtain a pointer to another interface, given a GUID that uniquely identifies that interface (commonly known as an interface ID, or IID). If the COM object does not implement that interface, an E_NOINTERFACE 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 ID is defined as a GUID with the value of {00000000-0000-0000-C000-000000000046}.Miscellaneous
*Components designed under the
ActiveX standard must, at minimal, implement the IUnknown interface. [http://msdn2.microsoft.com/en-us/library/aa751968.aspx ActiveX Controls] at [http://microsoft.com microsoft.com] ; accessed 18-Jan-2008]
*IUnknown serves as the base forMac OS X 'sCore Foundation CFPlugIn framework.Fact|date=June 2008Notes
ee also
*
IDispatch
Wikimedia Foundation. 2010.