Click to See Complete Forum and Search --> : AfxEnableControlContainer(); Error


vsayre
October 6th, 1999, 10:23 AM
In the middle of developing a Visual C++ app I upgraded to Visual C++ 6.0
and continued working. Then when I did a Rebuild All I got the error:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error C2065: 'AfxEnableControlContainer' : undeclared identifier

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

and can only get rid of it by commenting out the line "AfxEnableControlContainer();".
The line indicated is in the AppObject (see an extract below) which had been
generated by the Visual Studio Wizard and unmodified by me. Checking the helps
and the CodeGuru search indicated that this is still a vaild expression. Has
Visual C++ version 6.0 changed in a way that causes this error but has not been
documented? Or can this be generated by changes in another class? If so,
what can I look for to identify and resolve the cause of this error?

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CCWR0App::CCWR0App()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CCWR0App object

CCWR0App theApp;

/////////////////////////////////////////////////////////////////////////////
// CCWR0App initialization

BOOL CCWR0App::InitInstance()
{
AfxEnableControlContainer();

// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

ophirg
October 6th, 1999, 12:18 PM
Perhaps you need to #include <afxdisp.h> in stdafx.h

vsayre
October 6th, 1999, 02:11 PM
Tried including afxdisp.h in stdafx.h in all copies found under the Visual C++ directory C:\Program Files\Microsoft Development Studio\VC98 with no change in error response. Any other suggestions?

ophirg
October 7th, 1999, 11:09 AM
I meant the stdafx.h under your project.

vsayre
October 7th, 1999, 11:35 AM
Thanks, that worked!