3

我正在将现有的 c++ 项目从 32 位版本转换为 64 位版本。该项目在 32 位版本中构建良好,在配置管理器中转换为 x64 平台构建后,我收到以下构建错误,是否有任何特定的我必须为 64 位版本继承或者我缺少任何东西。

错误 C2259:“ATL::CComObject”:无法实例化抽象类 C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlcom.h

以下是构建项目时输出的错误。

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlcom.h(2000): error C2259: 'ATL::CComObject<Base>' : cannot instantiate abstract class
          with
          [
              Base=NAlertBand
          ]
          due to following members:
         'HRESULT IContextMenu::GetCommandString(UINT_PTR,UINT,UINT *,CHAR *,UINT)' : is abstract
          C:\Program Files (x86)\Windows Kits\8.0\Include\um\shobjidl.h(2732) : see declaration of 'IContextMenu::GetCommandString'
          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlcom.h(1989) : while compiling class template member function 'HRESULT ATL::CComCreator<T1>::CreateInstance(void *,const IID &,LPVOID *)'
          with
          [
              T1=ATL::CComObject<NAlertBand>
          ]
          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlcom.h(2096) : see reference to function template instantiation 'HRESULT ATL::CComCreator<T1>::CreateInstance(void *,const IID &,LPVOID *)' being compiled
          with
          [
              T1=ATL::CComObject<NAlertBand>
          ]
          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlcom.h(2095) : see reference to class template instantiation 'ATL::CComCreator<T1>' being compiled
          with
          [
              T1=ATL::CComObject<NAlertBand>
          ]
          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlcom.h(2091) : while compiling class template member function 'HRESULT ATL::CComCreator2<T1,T2>::CreateInstance(void *,const IID &,LPVOID *)'
          with
          [
              T1=ATL::CComCreator<ATL::CComObject<NAlertBand>>,
              T2=ATL::CComFailCreator<-2147221232>
          ]
          NAlerts.cxx(44) : see reference to function template instantiation 'HRESULT ATL::CComCreator2<T1,T2>::CreateInstance(void *,const IID &,LPVOID *)' being compiled
          with
          [
              T1=ATL::CComCreator<ATL::CComObject<NAlertBand>>,
              T2=ATL::CComFailCreator<-2147221232>
          ]
          NAlerts.cxx(44) : see reference to class template instantiation 'ATL::CComCreator2<T1,T2>' being compiled
          with
          [
              T1=ATL::CComCreator<ATL::CComObject<NAlertBand>>,
              T2=ATL::CComFailCreator<-2147221232>
          ]
  QMessage.cxx

谢谢

4

1 回答 1

2

这是一个类似的线程 - http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/d6144eaa-fa37-4133-87a0-75a06633209b

请同时发布其余的错误。

于 2013-01-16T09:36:47.107 回答