BookRags.com Literature Guides Literature
Guides
Criticism & Essays Criticism &
Essays
Questions & Answers Questions &
Answers
Lesson Plans Lesson
Plans
My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help

IUnknown

Print-Friendly
About 1 pages (201 words)

Bookmark and Share Know this topic well? Help others and get FREE products!

IUnknown is the name of 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. IUnknown comprises three functions – QueryInterface, AddRef, and Release.

  • 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.
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

External links

See also

View More Summaries on IUnknown
 
Ask any question on IUnknown and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
IUnknown from Wíkipedia. ©2006 by Wíkipedia. Licensed under the GNU Free Documentation License. View a list of authors or edit this article.

Article Navigation
Join BookRagslearn moreJoin BookRags




About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy