-1

I'm using VC6.How to solve the error?

error C2065: "error C2065: 'ON_WM_THEMECHANGED' : undeclared identifier"

Class Definition Code:

    #include "stdafx.h"
    #include "ConfigListCtrl.h"
    #include "CellCtrls\ListCtrlCellWnd.h"
    #include "CellCtrls\CellButton.h"
    #include "Windows.h"
    #include "Winuser.h"
    // CConfigListCtrl

    IMPLEMENT_DYNAMIC(CConfigListCtrl, CListCtrl)

    CConfigListCtrl::CConfigListCtrl() : m_bInit(FALSE), m_bCaretExists(FALSE), m_bTabbedIn(FALSE), m_bKeyUp(FALSE), m_bIsEnabled(TRUE)
    {
    }

    CConfigListCtrl::~CConfigListCtrl()
    {
        ForEachCellCtrl(&CConfigListCtrl::DeleteCellCtrl);
    }

    BEGIN_MESSAGE_MAP(CConfigListCtrl, CListCtrl)
...
        ON_WM_THEMECHANGED()
...
    END_MESSAGE_MAP()
    ...
    }

It seems that I have missed some header file or lib file, but what are they, how to solve it anyway?

Al2O3
  • 3,103
  • 4
  • 26
  • 52
  • 2
    Show the relevant code, please. – Michael Petrotta Dec 30 '12 at 03:48
  • 1
    The proper message cracker is is in ``, but it sounds like you need an updated Windows SDK first. Check your system's afxmsg.h file, and if its in there, you may not have the minimum _WIN32_WINNT defined to enable it (which is 0x501, btw). – WhozCraig Dec 30 '12 at 04:02

1 Answers1

1

Themes were first introduced with Windows XP, several years after VC6. You will need an updated Windows SDK with the appropriate win... .h files.

Mark Taylor
  • 1,843
  • 14
  • 17
  • I'm fairly new to windows programming, but how to update "Windows.h"?Thanks! – Al2O3 Dec 30 '12 at 03:57
  • 1
    @Ruby It comes updated with the latest [Windows SDK](http://www.microsoft.com/en-us/download/details.aspx?id=8279) (current version 7.1 if you're not interested in Metro, and if you are, you need to see a "special" doctor quick). – WhozCraig Dec 30 '12 at 04:00
  • 2
    @Ruby It **is** possible to use Visual Styles with MFC 6.0. However it requires that you get a new-ish SDK and compile the MFC from source yourself with `ISOLATION_AWARE_ENABLED` defined. There will be compilation errors down the road. Nothing major, but if you are just starting out this might be a bit too much. – IInspectable Dec 30 '12 at 04:03