错误C2065:'MIIM_STRING':未声明的标识符

时间:2010-09-24 11:49:58

标签: c++ windows shell-extensions submenu

尝试使用InsertMenuItem创建菜单到SubMenu时:

MENUITEMINFO mii = { sizeof(MENUITEMINFO) };

mii.fMask = MIIM_SUBMENU | MIIM_STRING | MIIM_ID;
mii.wID = uCmdID++;
mii.hSubMenu = hSubmenu;
mii.dwTypeData =  _T("Net&Work Drive Solution");


// InsertMenu ( hmenu, uMenuIndex, MF_BYPOSITION | MF_POPUP, 
            // (UINT_PTR) hSubmenu, _T("NetWork Drive Solution") );

InsertMenuItem ( hmenu, uMenuIndex, TRUE, &mii );
  

我收到错误C2065:'MIIM_STRING':未声明的标识符

1 个答案:

答案 0 :(得分:1)

您必须将WINVER定义为至少0x0500。 MIIM_STRING的定义如下:

#if(WINVER >= 0x0500)
#define MIIM_STRING      0x00000040
...