Building Graphical Menu Choices
-
Hi. I wrote a code that should have graphical menu choices. But I am getting error I believe it is syntax error where it does the menu choices. Can you please help me fix it for me? It has a lot of errors I believe they are syntax. I am thinking if I fix few errors all of them will be perfect. Please post your code. Thank you so much. Here is the part of the code that I have problem.
CWindow :
{
public:CContainedWindow m\_Parent; CWindow() : m\_Parent(this, 1){}
protected:
typedef CWindowImpl<T, TBase, TWinTraits> baseClass;
BEGIN_MSG_MAP(CWindow)
other msgs
ALT_MSG_MAP(1)
MESSAGE_HANDLER(WM_DRAWITEM, OnDrawItem)
END_MSG_MAP()
{}
};
CWindow
{
public:
DECLARE_WND_SUPERCLASS(_T("WTL_CButtonMenu"), GetWndClassName())
CButtonMenu& operator=(HWND hWnd)
{
if (m_hWnd)
DestroyWindow();
if (::IsWindow(hWnd))
SubclassWindow(hWnd);
return *this;
}
// Member variable of dialog
CWindow btnMenu;// Somewhere in WM\_INITDIALOG handler btnMenu = GetDlgItem(IDC\_BTN\_ABOUT); btnMenu.AddMenuItem(IDC\_MNU\_ONE, "Windows"); btnMenu.AddMenuItem(IDC\_MNU\_TWO, "Template"); btnMenu.AddMenuItem(IDC\_MNU\_THREE, "", MF\_SEPARATOR); btnMenu.AddMenuItem(IDC\_MNU\_FOUR, "Library");
};
-
Hi. I wrote a code that should have graphical menu choices. But I am getting error I believe it is syntax error where it does the menu choices. Can you please help me fix it for me? It has a lot of errors I believe they are syntax. I am thinking if I fix few errors all of them will be perfect. Please post your code. Thank you so much. Here is the part of the code that I have problem.
CWindow :
{
public:CContainedWindow m\_Parent; CWindow() : m\_Parent(this, 1){}
protected:
typedef CWindowImpl<T, TBase, TWinTraits> baseClass;
BEGIN_MSG_MAP(CWindow)
other msgs
ALT_MSG_MAP(1)
MESSAGE_HANDLER(WM_DRAWITEM, OnDrawItem)
END_MSG_MAP()
{}
};
CWindow
{
public:
DECLARE_WND_SUPERCLASS(_T("WTL_CButtonMenu"), GetWndClassName())
CButtonMenu& operator=(HWND hWnd)
{
if (m_hWnd)
DestroyWindow();
if (::IsWindow(hWnd))
SubclassWindow(hWnd);
return *this;
}
// Member variable of dialog
CWindow btnMenu;// Somewhere in WM\_INITDIALOG handler btnMenu = GetDlgItem(IDC\_BTN\_ABOUT); btnMenu.AddMenuItem(IDC\_MNU\_ONE, "Windows"); btnMenu.AddMenuItem(IDC\_MNU\_TWO, "Template"); btnMenu.AddMenuItem(IDC\_MNU\_THREE, "", MF\_SEPARATOR); btnMenu.AddMenuItem(IDC\_MNU\_FOUR, "Library");
};