error C2679:binary '+' no operator found which takes a right-hand operand of type 'const chavoid CExampleViewView::OnInitialUpdate(){\x09CView::OnInitialUpdate();\x09// TODO:Add your specialized code here and/or call the base class\x09CRect rcClient;

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 23:02:17
error C2679:binary '+' no operator found which takes a right-hand operand of type 'const chavoid CExampleViewView::OnInitialUpdate(){\x09CView::OnInitialUpdate();\x09// TODO:Add your specialized code here and/or call the base class\x09CRect rcClient;
xT]OA+7կOߜʦ}Yޱ˼рs4?7>8sp:sn7L$ܧ Fn

error C2679:binary '+' no operator found which takes a right-hand operand of type 'const chavoid CExampleViewView::OnInitialUpdate(){\x09CView::OnInitialUpdate();\x09// TODO:Add your specialized code here and/or call the base class\x09CRect rcClient;
error C2679:binary '+' no operator found which takes a right-hand operand of type 'const cha
void CExampleViewView::OnInitialUpdate()
{
\x09CView::OnInitialUpdate();
\x09// TODO:Add your specialized code here and/or call the base class
\x09CRect rcClient;
\x09GetClientRect(rcClient);
\x09if(m_ctrlEdit) delete m_ctrlEdit;
\x09m_ctrlEdit = new CEdit();
\x09m_ctrlEdit ->Create(ES_MULTILINE|WS_CHILD|WS_VISIBLE|WS_HSCROLL|ES_AUTOHSCROLL|WS_VSCROLL|ES_AUTOVSCROLL,rcClient,this,201);
\x09CExampleViewDoc* pDoc = GetDocument();
\x09CString str;
\x09int nLines = (int)pDoc->m_strContent.GetSize();
\x09for(int i=0;im_strContent.GetAt(i);
\x09\x09str = str + "\r\n";
\x09}
\x09m_ctrlEdit->SetTabStops(16);
\x09m_ctrlEdit->SetWindowText(str);
}

error C2679:binary '+' no operator found which takes a right-hand operand of type 'const chavoid CExampleViewView::OnInitialUpdate(){\x09CView::OnInitialUpdate();\x09// TODO:Add your specialized code here and/or call the base class\x09CRect rcClient;
这一句
str = str + "\r\n";
改成

str = str + _T("\r\n");


应该是由于开启了Unicode.所以CString内部类型实际是wchar_t而不是char,你在操作裸字符串的时候也要加上_T()宏以表示是宽字符集.