|
IUnknown
The IUnknown interface lets clients get pointers to other interfaces on a given object
through the QueryInterface method, and manage the existence of the object through the IUnknown::AddRef and IUnknown::Release methods. All other COM interfaces are inherited, directly or indirectly, from IUnknown. Therefore, the three methods in IUnknown are the first entries in the VTable for every interface.
When to Implement
You must implement IUnknown as part of every interface. If you are using C++ multiple inheritance to
implement multiple interfaces, the various interfaces can share one implementation
of IUnknown. If you are using nested classes to implement multiple interfaces, you must
implement IUnknown once for each interface you implement.
When to Use
Use IUnknown methods to switch between interfaces on an object, add references, and
release objects.
Methods in Vtable Order
IUnknown Methods
| Description
| QueryInterface
| Returns pointers to supported interfaces.
| AddRef
| Increments reference count.
| Release
| Decrements reference count.
|
Related LinksSoftware for Delphi and C++ Builder developers Software for Visual Studio .NET developers Software for Visual Basic 6 developers Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps Win32 Programmer's Reference (win32.hlp) Win32 Multimedia Programmer's Reference (mmedia.hlp) Microsoft Windows Pen API Programmer's Reference (penapi.hlp) Microsoft Windows Sockets 2 Reference (sock2.hlp) Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp) Unix Manual Pages
|