错误信息?
将GetCursorPos(&pt);改为
ASSERT(GetCursorPos(&pt));

解决方案 »

  1.   

    GetSubMenu(0) 是第一项的子菜单,确认IDR_MENU1 的第一项是子菜单
      

  2.   

    我第一次用也疑惑,后来用变量累加着调用,总算知道了
    //       static int nIndex = 0;
    CMenu *pSubMenu;
    pSubMenu = m_hPopupMenu.GetSubMenu(0); //Index to first submenu
    // if Menu changed, change the number "22" too.
    pSubMenu = pSubMenu->GetSubMenu(22); // Point to target menu
    //       pSubMenu = pSubMenu->GetSubMenu(nIndex++);
    return pSubMenu;
    Seperater 也算个数