void CtestDlg::OnUpdatePopDeletemode(CCmdUI *pCmdUI)
{
// TODO: 在此添加命令更新用户界面处理程序代码
pCmdUI->SetCheck(DeleteFlag == true);
}void CtestDlg::OnPopDeletemode()
{
// TODO: 在此添加命令处理程序代码
DeleteFlag = true;}
照书上弄的,
大概代码如上,其实我是想菜单点击后被勾上了为“true”,去掉勾,就是“false”,变量在对话框的类里添加的;
IDR_MENU1的Checked属性已为True
还差什么地方没做对吗?谢谢!!!现在始终为勾上,再点击也是为勾上,试过做这样的切换,bool属性是切换了,不过勾子没变化 if(DeleteFlag == true)
{
DeleteFlag = false;
return;
} if(DeleteFlag == false)
{
DeleteFlag = true;
return;
}

解决方案 »

  1.   

    BOOL bCheck = FALSE;void CMainFrame::OnMenuaa() 
    {
    // TODO: Add your command handler code here
    bCheck = !bCheck;
    }void CMainFrame::OnUpdateMenuaa(CCmdUI* pCmdUI) 
    {
    // TODO: Add your command update UI handler code here
    pCmdUI->SetCheck(bCheck);
    }
      

  2.   

    CreateProcess(),哪个STARTUPINFO结构体里的FLAG的ShowWindow 设置HIDE也不行吗?
      

  3.   

    void COutPutView::OnScale() 
    {
    // TODO: Add your command handler code here
    b_hasScale=!b_hasScale;
    m_scaleTracker.m_nStyle=CRectTracker::resizeOutside|CRectTracker::dottedLine;
    CRect rect=m_scaleTracker.m_rect;
    rect.SetRect(rect.left-5,rect.top-5,rect.right+5,rect.bottom+5);
    InvalidateRect(rect);UpdateWindow();
    }void COutPutView::OnUpdateScale(CCmdUI* pCmdUI) 
    {
    // TODO: Add your command update UI handler code here
    pCmdUI->SetCheck(b_hasScale);
    }
    我的也没问题,你看看你的消息响应是不是有问题,在pCmdUI->SetCheck(DeleteFlag == true);设断点看看