请问下面的警告是什么意思?
F:\作业\Vc\图书管理系统\ts\tsView.cpp(179) : warning C4390: ';' : empty controlled statement found; is this the intent?
附部分源码如下:void CTsView::OnButtonChaxu() 
{
// TODO: Add your control notification handler code here
Cchaxu cx;
cx.DoModal();
if(cx.DoModal()==IDOK);
m_pSet->m_sm="书名"+cx.m_cxcm;
m_pSet->Requery();
UpdateData(FALSE);
}

解决方案 »

  1.   

    void CTsView::OnButtonChaxu() 
    {
    // TODO: Add your control notification handler code here
    Cchaxu cx;if(cx.DoModal()!=IDOK)
     return;
    m_pSet->m_sm="书名"+cx.m_cxcm;
    m_pSet->Requery();
    UpdateData(FALSE);
    }
      

  2.   

    if(cx.DoModal()==IDOK);
    这句的后边没有分号
      

  3.   

    这个警告的意思是:发现空的控制语句。
    产生的原因是:
    if( ... ) ;
    这个语句造成条件为真时,不做任何事情。
    估计你想写成:
    if(cx.DoModal()==IDOK)
        m_pSet->m_sm="书名"+cx.m_cxcm;
      

  4.   

    if(cx.DoModal()==IDOK);
    本来完整的写法因该是这样:
           if(....)
           {};
     你没有写{} 直接就;
    就是说有空的控制语句,所以会抱警告!