Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
'
HRESULT' is being converted to 'bool'; are you sure this is what you want?
Remarks
When an HRESULT is used in an if statement, the HRESULT is converted to a bool unless you explicitly test for the variable as an HRESULT.
Warning C4165 is off by default. For more information, see Compiler Warnings That Are Off By Default.
Example
The following example generates C4165:
// C4165.cpp
// compile with: /W3
#include <windows.h>
#pragma warning(3:4165)
extern HRESULT hr;
int main() {
if (hr) {
// try either of the following ...
// if (FAILED(hr)) { // C4165 expected
// if (hr != S_OK) {
}
}