ISomeInterface * psome = (some function returning an ISomeInterface *);
where ISomeInterface derives from IUnknown. Suppose further that the following operation is attempted:
IOtherInterface * pother;
HRESULT hr;
hr=psome->QueryInterface(IID_IOtherInterface, &pother); //line 4
Then, the following must be true:
Statement | Logic |
Symmetric: | psome->QueryInterface(IID_ISomeInterface, ...) must succeed |
Reflexive: | If in line 4, pother was successfully obtained, then pother->QueryInterface(IID_ISomeInterface, ...) must succeed. |
Transitive: | If in line 4, pother was successfully obtained, and we do IYetAnother * pyet; pother->QueryInterface(IID_IYetAnother, &pyet); //Line 7 and pyet is successfully obtained in line 7, then pyet->QueryInterface(IID_ISomeInterface, ...) must succeed. |
Argument | Type | Description |
iid | REFIID | The interface identifier desired. |
ppv | void** | Pointer to the object with the desired interface. In the case that the interface is not supported or another error occurred, *ppv must be set to NULL. |
Return Value | Meaning |
S_OK | Success. The interface is supported |
E_NOINTERFACE | The interface is not supported |
E_UNEXPECTED | An unknown error occurred. |