NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Warning (level 1) C4165

'HRESULT' is being converted to 'bool'; are you sure this is what you want?

When using an HRESULT in an if statement, the HRESULT will be converted to a bool unless you explicitly test for the variable as an HRESULT. This warning is off by default.

The following sample generates C4165

#include <windows.h>
#pragma warning(1:4165)

extern HRESULT hr;
void main() {
   if (hr) {
   // try either of the following ...
   // if (FAILED(hr)) {
   // if (hr != S_OK) {
   }
}