一个MFC的画图软件,为什么我弄的按钮出来是灰色的呢
VCadView.CPPON_COMMAND_RANGE(ID_MOVE,ID_MIRROR,CVCadView::OnModifyEntity)
ON_UPDATE_COMMAND_UI_RANGE(ID_MOVE,ID_MIRROR,CVCadView::OnUpdateModifyCommand)void CVCadView::OnModifyEntity(int m_nID)
{
CVCadDoc* pDoc=GetDocument();
ASSERT(pDoc);if(m_pCmd)
{  
m_pCmd->Cancel();
delete m_pCmd;
m_pCmd=NULL;  
}if(pDoc->m_selectArray.GetSize()==0)
{
CString strError = _T("请首先选取图元"); 
AfxMessageBox(strError);
return;
}
switch(m_nID)
{
case ID_MOVE: // 平移
{
m_pCmd=new CMove();
break;
}
case ID_ROTATE: // 旋转
{
m_pCmd=new CRotate();
break;
}
case ID_MIRROR: // 镜像
{
m_pCmd=new CMirror();
break;
}
default:
break;
}
}
void CVCadView::OnUpdateModifyCommand(CCmdUI* pCmdUI)
{
CVCadDoc* pDoc=GetDocument();
ASSERT(pDoc);if(pDoc->m_selectArray.GetSize ()==0)
{
pCmdUI->Enable (false); 
return;
}int flag=0 ;
switch(pCmdUI->m_nID)
{
case ID_MOVE:
{
if((m_pCmd!=NULL && m_pCmd->GetType ()==ctMove))
flag=1;
break;
}
case ID_ROTATE:
{
if((m_pCmd!=NULL && m_pCmd->GetType ()==ctRotate))
flag=1;
break;
}
case ID_MIRROR:
{
if((m_pCmd!=NULL && m_pCmd->GetType ()==ctMirror))
flag=1;
break;
}
default:
break;
}
pCmdUI->SetCheck (flag);
}VCadView.h  protected:
//{{AFX_MSG(CVCadView)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnCancelMode();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnCaptureChanged(CWnd *pWnd);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnPick();
afx_msg void OnUpdatePick(CCmdUI* pCmdUI);
//}}AFX_MSG
afx_msg void OnCreateEntity(int m_nID);
afx_msg void OnUpdateCreateCommand(CCmdUI *pCmdUI);
afx_msg void OnModifyEntity(int m_nID);
afx_msg void OnUpdateModifyCommand(CCmdUI* pCmdUI);
DECLARE_MESSAGE_MAP()