在鼠标右键菜单ONCONTEXTMENU函数里面,有这么一段
CMenu menu;
VERIFY(menu.LoadMenu(CG_IDR_POPUP_TYPING_TEST_VIEW));
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
CWnd* pWndPopupOwner = this;
while (pWndPopupOwner->GetStyle() & WS_CHILD)
pWndPopupOwner = pWndPopupOwner->GetParent();
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,pWndPopupOwner);
}
请问下这个WHILE循环有必要吗?不写WHILE循环可以吗?