Thursday, December 24, 2020

Error C2065 'afxChNil': undeclared identifier Demo2 c:\demo_temp\sizecbar_src\src\sizecbar.cpp 1296

to test Demo2, after I corrected all configuration property set up, such as $(SolutionDir)$(Configuration)\, and $(OutDir)$(TargetName)$(TargetExt), removed some warnings, compiled it, I am still get the final eorror(hopefully):

Error C2065 'afxChNil': undeclared identifier Demo2 c:\demo_temp\sizecbar_src\src\sizecbar.cpp 1296

pin point the location in the source code:

if (!CMiniFrameWnd::CreateEx(dwExStyle, NULL, &afxChNil, dwStyle, rectDefault, pParent))
{
m_bInRecalcLayout = FALSE;
return FALSE;
}

it is residing in this statement: CMiniFrameWnd::CreateEx

just neeed to figure out what type of this variable, then redefine it in this source code file:

  1. Parameters for CFrameWnd::CreateEx called by CFrameWnd::Create
  2. lpszWindowName lpszWindowName

    so afxChNil is constant string: jut define as below:
    TCHAR afxChNil;

    my fix is working well.

  3. Free MFC Source Code
  4. CSizingControlBar: resizable control bars by Cristi Posea. Do you need an edit control, tabbed tree or other window to be docked to the frame's sides? But after browsing through the MFC documentation, didn't find nothing like this? You came to the right place. CSizingControlBar is an easy to use collection of classes, allowing you to focus on your application needs rather than on implementation tweaks.

  5. Dynamic child window positioning
  6. CSizingControlBar - A Resizable Control Bar
  7. How to verify the bar state info
  8. Reference

  9. CFrameWnd
  10. CWnd Class ==> CreateEx() parameters
  11. virtual BOOL CreateEx( DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU nIDorHMenu, LPVOID lpParam = NULL);

    virtual BOOL CreateEx( DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, LPVOID lpParam = NULL);

No comments:

Post a Comment