Quakey
June 2nd, 1999, 02:39 PM
Hi there,
I wanted to modify the string of many menuitems on the fly. Here are the codes I used:
CMenu* hMenuCopy;
hMenuCopy=new CMenu;
hMenuCopy->LoadMenu(IDR_MENU_Display);
hMenuCopy->GetSubMenu(0)->GetSubMenu(7)->ModifyMenu(1,MF_STRING|MF_BYPOSITION,hMenuCopy->GetSubMenu(0)->GetSubMenu(7)->GetMenuItemID(1),Field1);
However, it doesn't work. Please tell me what's wrong. By the way, if I obtain the menu by using
GetMenu() rather than LoadMenu, those codes work. Why? Thanks in advance.
I wanted to modify the string of many menuitems on the fly. Here are the codes I used:
CMenu* hMenuCopy;
hMenuCopy=new CMenu;
hMenuCopy->LoadMenu(IDR_MENU_Display);
hMenuCopy->GetSubMenu(0)->GetSubMenu(7)->ModifyMenu(1,MF_STRING|MF_BYPOSITION,hMenuCopy->GetSubMenu(0)->GetSubMenu(7)->GetMenuItemID(1),Field1);
However, it doesn't work. Please tell me what's wrong. By the way, if I obtain the menu by using
GetMenu() rather than LoadMenu, those codes work. Why? Thanks in advance.