'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) { } }