tags:

views:

973

answers:

2

Hey, I created a dialog base application using the wizard in VS C++ 2008. Haven't added any code my self. When I compile I get a few errors saying that CWinAppEx is undefined.

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
+3  A: 

CWinAppEx is available only if you have installed Visual Studio 2008 SP1, which I think you already have since you were able to generate with the wizard code that uses CWinAppEx.

CWinAppEx is located in afxwinappex.h, maybe you don't have this include in the stdafx.h header.

Cristian Adam
yea i included that file and it worked perfectly, but why the hell when VS generates that class but doesn't adds the required header files.
hab
I guess you found a bug in Visual Studio. You should report this to Microsoft through their bug reporting portal: http://connect.microsoft.com/
Cristian Adam
I think @AshleysBrain is correct in that afxwinappex.h is part of the Visual Studio 2008 Feature Pack, not SP1.
Kristopher Johnson
Visual Studio 2008 SP1 includes Visual Studio 2008 Feature Pack.
Cristian Adam
+2  A: 

CWinAppEx is part of the Visual Studio 2008 Feature Pack, which includes things like MFC classes for ribbon user interfaces.

You can download it here: http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en

Here's its MSDN page (notice it is under the MFC Feature Pack for Visual Studio 2008 category): http://msdn.microsoft.com/en-us/library/bb983877.aspx

AshleysBrain