编译我的代码时,编译器会出现一些错误。
错误:
Error 1 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
Error 7 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
Error 11 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
Error 16 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
Error 22 error C2039: 'AtlThrowImpl' : is not a member of 'ATL' e:\program files\microsoft visual studio 9.0\vc\include\atlalloc.h 184
这是 header 的代码部分:
template <typename T>
inline T AtlThrow(T tLeft, T tRight)
{
T tResult;
HRESULT hr=AtlAdd(&tResult, tLeft, tRight);
if(FAILED(hr))
{
AtlThrow(hr);
}
return tResult;
}
我的问题:如何从 header 中修复此错误?我是否需要安装一些SDK或一些有关ATL的东西?
最佳答案
您的代码中有些东西从编译器输入中排除了AtlThrowImpl
:
<atlexcept.h>
_ATL_NO_EXCEPTIONS
_ATL_CUSTOM_THROW
__ATLEXCEPT_H__
<atlexcept.h>
AtlThrowImpl
在atlexcept.h中,在您面前有完整的项目,您可以检查确切的冲突并将其排除在外。