嘿,我在VS C ++ 2008中使用向导创建了一个对话框基础应用程序。没有添加我自己的任何代码。当我编译时,我得到一些错误,说CWinAppEx未定义。
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
答案 0 :(得分:6)
CWinAppEx仅在您安装了Visual Studio 2008 SP1时可用,我认为您已经拥有了Visual Studio 2008 SP1,因为您可以使用使用CWinAppEx的向导代码生成。
CWinAppEx位于afxwinappex.h中,也许你在stdafx.h标题中没有这个包含。
答案 1 :(得分:2)
CWinAppEx是Visual Studio 2008 Feature Pack的一部分,其中包含用于功能区用户界面的MFC类。
这是它的MSDN页面(注意它是在Visual Studio 2008类别的MFC Feature Pack下): http://msdn.microsoft.com/en-us/library/bb983877.aspx