2013-01-16 38 views
3

我將現有的C++項目從32位版本轉換爲64位版本。此項目在32位版本中生成良好,轉換爲配置管理器中的x64平臺構建後,我得到了波紋管生成錯誤,是否有任何具體的我必須繼承爲64位版本或我缺少任何東西。atlcom.h當爲平臺設置爲x64而構建時出現錯誤

錯誤C2259: 'ATL :: CComObject':不能實例化抽象類 C:\ Program Files文件(x86)的\微軟的Visual Studio 11.0 \ VC \ atlmfc \ \包括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 

感謝

+0

發佈實現實際的'NAlertBand :: GetCommandString'的代碼部分。問題是它的參數與它們應該匹配的不匹配。在Win32中,按照發生率進行匹配,並且這在x64中不會發生。 –

回答

相關問題