I cannot reproduce the compiler error in vs2008 in the small program below. There is probably something else in your included files, preprocessor definitions, or compiler options that give you different behavior.
IUnknownPtr if?
, ?
OK?
if (NULL == (IUnknownPtr ptr = someOtherPtr)) {
}
IUnknownPtr foo;
bool b(foo);
, IUnknownPtr, IUnknownPtr bool.
operator = IUnknownPtr & (, ). _com_ptr_t bool(). _COM_SMARTPTR_TYPEDEF _com_ptr_t - ? , (/++// )
#include <comdef.h>
int main(int argc, char* argv[])
{
IUnknownPtr foo;
IUnknown* foo2 = NULL;
if (IUnknownPtr foo3 = foo) {
}
if (IUnknownPtr foo4 = foo2) {
}
return 0;
}