编译出错求解

cerealsun 2011-05-04 01:47:14
int i, nLineCount = m_myEdit.GetLineCount();
CString strText, strLine;
// Dump every line of text of the edit control.
for (i=0; i < nLineCount; i++)
{
// length of line i:
int len = m_myEdit.LineLength(m_myEdit.LineIndex(i));
m_myEdit.GetLine(i, strText.GetBuffer(len), len);
strText.ReleaseBuffer(len);
strLine.Format(_T("line %d: '%s'\n"), i, strText);
AFXDUMP(strLine);
}
编译时
error C2664: 'AfxDump' : cannot convert parameter 1 from 'class CString' to 'const class CObject *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.
...全文
74 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
yjueqtd 2011-05-21
  • 打赏
  • 举报
回复
AfxMessageBox(strLine);
向立天 2011-05-21
  • 打赏
  • 举报
回复
您好
我是本版版主
此帖已多日无人关注
请您及时结帖
如您认为问题没有解决可按无满意结帖处理
另外本版设置了疑难问题汇总帖
并已在版面置顶
相关规定其帖子中有说明
您可以根据规定提交您帖子的链接
如您目前不想结帖只需回帖说明
我们会删除此结帖通知

见此回复三日内无回应
我们将强制结帖
相关规定详见界面界面版关于版主结帖工作的具体办法
jdzfjfhnui 2011-05-04
  • 打赏
  • 举报
回复
afxDump<<strLing;
dump到输出窗口
oyljerry 2011-05-04
  • 打赏
  • 举报
回复
AFXDUMP(strLine);
---> AfxMessageBox(strLine);
Eleven 2011-05-04
  • 打赏
  • 举报
回复
或者使用TRACE0((LPCTSTR)strLine);也可以
  • 打赏
  • 举报
回复
AFXDUMP(strLine);这句是干嘛的

删掉
Eleven 2011-05-04
  • 打赏
  • 举报
回复
你用AfxMessageBox(strLine);
输出来就可以了

15,979

社区成员

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

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