The IUnknown::QueryInterface method determines if 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* obp
);
If the method succeeds, the return value is S_OK.
If the method fails, the return value may be E_NOINTERFACE, E_POINTER, or one of the following interface-specific error values. Interface-specific error values are listed by component.
DDERR_INVALIDPARAMS
DDERR_OUTOFMEMORY (DirectDrawSurface objects only)
DSERR_INVALIDPARAM
DSERR_NOINTERFACE
DPERR_INVALIDPARAMS
For Direct3D Retained Mode and Immediate Mode interfaces, the QueryInterface method returns one of the values in Direct3D Retained Mode Return Values and Direct3D Immediate Mode Return Values.
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 allows Microsoft and third parties to extend objects without interfering with each other's existing or future functionality.
This method is part of the IUnknown interface inherited by the object.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in unknwn.h.