try the following code...
0x8000, 0x9500 is too wide a range....you should only cover as much range as you need... and make sure that the range is in the right order... other wise it will still fail....
This is also assuming that ID_HELP_NEW and ID_HELP_NEW2 are items that already exist in the menu and you are simply using them to add 2 more new items....
Code:
void CMainFrame::OnAddHelpItems(UINT id)
{
switch (id) {
case ID_HELP_NEW: {
AfxMessageBox("Add Code to handle new menu 1");
CMenu* mmenu = GetMenu();
CMenu* submenu = mmenu->GetSubMenu(0);
submenu->AppendMenu(MF_STRING, 0x9040, "Add this &Where");
}
case ID_HELP_NEW2: {
AfxMessageBox("Add Code to handle new menu 2");
CMenu* mmenu = GetMenu();
CMenu* submenu = mmenu->GetSubMenu(4);
submenu->AppendMenu(MF_STRING, 0x9660, "Add this &Where");
}
}
}
...
IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
ON_WM_SETFOCUS()
ON_WM_RBUTTONDOWN()
ON_COMMAND_RANGE(ID_HELP_NEW, ID_HELP_NEW2, OnAddHelpItems)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
...