IUnknown
Encyclopedia
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.
(sometimes called functions):
The IUnknown interface ID is defined as a GUID
with the value of {00000000-0000-0000-C000-000000000046}.
Interface (computer science)
In the field of computer science, an interface is a tool and concept that refers to a point of interaction between components, and is applicable at the level of both hardware and software...
is the fundamental interface in the Component Object Model
Component Object Model
Component Object Model is a binary-interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages...
(COM). The published 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 methodsMethod (computer science)
In object-oriented programming, a method is a subroutine associated with a class. Methods define the behavior to be exhibited by instances of the associated class at program run time...
(sometimes called functions):
QueryInterface
, AddRef
, and Release
:-
QueryInterface
is used to obtain a pointer to another interface, given a GUIDGlobally Unique IdentifierA globally unique identifier is a unique reference number used as an identifier in computer software. The term GUID also is used for Microsoft's implementation of the Universally unique identifier standard....
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
Globally Unique Identifier
A globally unique identifier is a unique reference number used as an identifier in computer software. The term GUID also is used for Microsoft's implementation of the Universally unique identifier standard....
with the value of {00000000-0000-0000-C000-000000000046}.
Miscellaneous
- Components designed under the ActiveXActiveXActiveX is a framework for defining reusable software components in a programming language-independent way. Software applications can then be composed from one or more of these components in order to provide their functionality....
standard must, at minimal, implement the IUnknown interface. - IUnknown serves as the base for Mac OS XMac OS XMac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
's Core FoundationCore FoundationCore Foundation is a C application programming interface in Mac OS X & iOS, and is a mix of low-level routines and wrapper functions...
CFPlugIn framework.