When compiling the C/C++ examples, include the following in your project:
#define IFS(fn) \ { \ if (SUCCEEDED(hr)) \ { \ hr = (fn); \ } \ } #define RELEASE_INTERFACE(pi) \ { \ if (pi) \ { \ pi->Release(); \ pi = NULL; \ } \ } #define DELETE_POINTER(p) \ { \ if (p) \ { \ delete p; \ p = NULL; \ } \ }
#include <atlstr.h>