|
ModifyMenu修改PopupMenu菜单问题
[复制链接]
使用如下方式创建了菜单
CMenu *mCurveMenu = new CMenu;
ASSERT(NULL != mCurveMenu);
BOOL ret = TRUE;
ret = mCurveMenu->CreatePopupMenu();
ret = mCurveMenu->AppendMenu(MF_STRING, IDM_CURVE_ENOW,
mMultiLang->LoadString(L"IDS_MENU_OVERVIEW_RT"));
ret = mCurveMenu->AppendMenu(MF_STRING, IDM_CURVE_EMONTH,
mMultiLang->LoadString(L"IDS_MENU_OVERVIEW_MONTH"));
ret = mCurveMenu->AppendMenu(MF_STRING, IDM_CURVE_EYEAR,
mMultiLang->LoadString(L"IDS_MENU_OVERVIEW_YEAR"));
然而在用ModifyMenu修改菜单时第一个子菜单修改不成功,后面的都可以
BOOL ret = mCurveMenu->ModifyMenu(IDM_CURVE_ENOW, MF_BYCOMMAND, IDM_CURVE_ENOW, mMultiLang->LoadString(L"IDS_MENU_OVERVIEW_RT")); // 此名将返回失败,后面的第两条修改菜单语句都能修改成功。
ret = mCurveMenu->ModifyMenu(IDM_CURVE_EMONTH, MF_BYCOMMAND, IDM_CURVE_EMONTH, mMultiLang->LoadString(L"IDS_MENU_OVERVIEW_MONTH"));
ret = mCurveMenu->ModifyMenu(IDM_CURVE_EYEAR, MF_BYCOMMAND, IDM_CURVE_EYEAR, mMultiLang->LoadString(L"IDS_MENU_OVERVIEW_YEAR"));
请大家帮看看是什么原因?
如何修改。
谢谢
|
|