2009-10-02 70 views
1

嗨,我創建了一個對話框基礎應用程序使用嚮導在VS C++ 2008.沒有添加任何代碼我自己。當我編譯時,我得到一些錯誤,說CWinAppEx是未定義的。CWinAppEx undefined class

c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.h(19) : error C2504: 'CWinAppEx' : base class undefined 
c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.cpp(16) : error C2146: syntax error : missing ';' before identifier 'TheBaseClass' 
c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.cpp(16) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.cpp(16) : error C2065: 'TheBaseClass' : undeclared identifier 
c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.cpp(17) : error C2248: 'CWinApp::OnHelp' : cannot access protected member declared in class 'CWinApp' 
     c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxwin.h(4953) : see declaration of 'CWinApp::OnHelp' 
     c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxwin.h(4737) : see declaration of 'CWinApp' 
c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.cpp(18) : error C2653: 'TheBaseClass' : is not a class or namespace name 
c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.cpp(49) : error C2653: 'CWinAppEx' : is not a class or namespace name 
c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.cpp(60) : error C3861: 'SetRegistryKey': identifier not found 
c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.cpp(63) : error C2065: 'm_pMainWnd' : undeclared identifier 
IvrEngineDlg.cpp 
c:\documents and settings\hussain\my documents\visual studio 2008\projects\ivrengine\ivrengine\ivrengine.h(19) : error C2504: 'CWinAppEx' : base class undefined 

回答

5

CWinAppEx僅當您已經安裝了Visual Studio 2008 SP1,我認爲你已經有了,因爲你是能夠與使用CWinAppEx嚮導代碼來生成。

CWinAppEx位於afxwinappex.h中,也許你沒有包含在stdafx.h頭文件中。

+0

是啊,我包括該文件它完美地工作,但是爲什麼當VS生成那個類時卻沒有添加所需的頭文件。 – akif 2009-10-02 11:50:09

+0

我想你在Visual Studio中發現了一個錯誤。您應該通過他們的錯誤報告門戶向Microsoft報告此問題:http://connect.microsoft.com/ – 2009-10-02 12:32:13

+0

我認爲@AshleysBrain正確,因爲afxwinappex.h是Visual Studio 2008功能包的一部分,而不是SP1。 – 2010-10-25 13:00:44

相關問題