在线等,帮小弟一个忙

fefang2003 2003-12-17 10:12:36
请问下面的警告是什么意思?
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);
}
...全文
65 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Tiger_张虎 2003-12-17
  • 打赏
  • 举报
回复
这个警告的意思是:发现空的控制语句。
产生的原因是:
if( ... ) ;
这个语句造成条件为真时,不做任何事情。
估计你想写成:
if(cx.DoModal()==IDOK)
m_pSet->m_sm="书名"+cx.m_cxcm;
carbon107 2003-12-17
  • 打赏
  • 举报
回复
if(cx.DoModal()==IDOK);
这句的后边没有分号
hxzb7215191 2003-12-17
  • 打赏
  • 举报
回复
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);
}
arvid_gs 2003-12-17
  • 打赏
  • 举报
回复
if(cx.DoModal()==IDOK);
本来完整的写法因该是这样:
if(....)
{};
你没有写{} 直接就;
就是说有空的控制语句,所以会抱警告!

4,018

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧