CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 1999
    Posts
    4

    AfxEnableControlContainer(); Error

    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.



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



  2. #2
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    34

    Re: AfxEnableControlContainer(); Error

    Perhaps you need to #include <afxdisp.h> in stdafx.h


  3. #3
    Join Date
    Oct 1999
    Posts
    4

    Re: AfxEnableControlContainer(); Error

    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?


  4. #4
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    34

    Re: AfxEnableControlContainer(); Error

    I meant the stdafx.h under your project.


  5. #5
    Join Date
    Oct 1999
    Posts
    4

    Re: AfxEnableControlContainer(); Error

    Thanks, that worked!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured