1. Problems with com_cast
:\experiment\console\main.cpp(282) : error C2440: 'type cast' :
cannot convert from 'class comet::com_ptr<struct IUnknown>'
to 'class ATL::CComQIPtr'
Cause: Line 857 of
<atlbase.h> defines a macro
#define com_cast CComQIPtr
This conflicts with the Comet
com_cast class in the comet
namespace. However, because ATL has used the preprocessor instead of typedef
or other means (*sigh*), there is no easy way to avoid this conflict.
If a comet header is defined after ATL, this macro will be automatically
undefined. However, if you are seeing this error, you must be including
<atlbase.h> after any Comet header files, and then trying
to use Comet's
com_cast class in your code.
1. Ensure that
<atlbase.h> is included before
a Comet header file. e.g.
Any of the Comet header files will undefine ATL's definition of com_cast before replacing it with the Comet version.
2. Ensure that
com_cast is undefined. e.g.
No help here? Mail us with your problem.