Microsoft DirectX 8.1 (C++) |
IUnknown::QueryInterface
Determines whether the object supports a particular COM interface. If it does, the system increases the object's reference count, and the application can use that interface immediately.
HRESULT QueryInterface( REFIID riid, LPVOID* ppvObj );
Parameters
- riid
- Reference identifier of the interface being requested.
- ppvObj
- Address of a pointer to fill with the interface pointer if the query succeeds.
Return Values
If the method succeeds, the return value is S_OK.
If the method fails, the return value may be E_NOINTERFACE or E_POINTER. Some components also have their own definitions of these error values in their header files. In Microsoft® DirectInput®, for example, DIERR_NOINTERFACE is equivalent to E_NOINTERFACE.
Remarks
If the application does not need to use the interface retrieved by a call to this method, it must call the Release method for that interface to free it. The QueryInterface method enables Microsoft and third parties to extend objects without interfering with existing or evolving functionality.
Requirements
Windows NT/2000/XP: Requires Windows NT 3.1 or later.
Windows 98/Me: Requires Windows 98 or later.
Header: Declared in Unknwn.h.