早教吧作业答案频道 -->其他-->
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 classx09CRect 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);
}
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);
}
▼优质解答
答案和解析
这一句
str = str + "\r\n";
改成
str = str + _T("\r\n");
应该是由于开启了Unicode.所以CString内部类型实际是wchar_t而不是char,你在操作裸字符串的时候也要加上_T()宏以表示是宽字符集.
str = str + "\r\n";
改成
str = str + _T("\r\n");
应该是由于开启了Unicode.所以CString内部类型实际是wchar_t而不是char,你在操作裸字符串的时候也要加上_T()宏以表示是宽字符集.
看了 error C2679:bi...的网友还看了以下:
thelitmuspaperturnsbluewhenthesolutionisabase当溶液是 2020-04-26 …
引物中base单位与碱基对有什么关系?比如NC5(5’TAGGTGAACCTGCGGAAGGATC 2020-05-13 …
error C2679:binary "+" no operator found which ta 2020-05-14 …
英国哪里买到base formula?如题 英国哪里能买到base formula的面膜? 2020-05-16 …
( 15 )支持单模光纤的千兆以太网物理层标准是A ) 1000BASE-LX B ) 1000 B 2020-05-23 …
支持单模光纤的千兆以太网物理层标准是A.1 000BASE-LXB.1000 BASE-SXC.1 2020-05-23 …
100 BASE-T标准可以支持多种传输介质,下列叙述中错误的是( )A.100 BASE-TX支持 2020-05-24 …
下列不属于1000 BASE-T有关传输介质的标准的是()。A.1000 BASE-TB.1000 2020-05-24 …
程序设计试题23.在下面一段类定义中,Derived类公有继承了基类Base。需要填充的函数由注释 2020-07-20 …
base用法base一般用法是basesth还是baseonsth?base一般不是及物动词吗?为 2020-07-27 …