问答网 问答 其它 【errorC2679:binary'+'nooperatorfoundwhichtakesaright-handoperandoftype'constchavoidCExampleViewView::OnInitialUpdate(){x09CView::OnInitialUpdate();x09//TODO:Addyourspecializedcodehereand/orcallthebaseclassx09CRectrcClient;】
问题标题:
【errorC2679:binary'+'nooperatorfoundwhichtakesaright-handoperandoftype'constchavoidCExampleViewView::OnInitialUpdate(){x09CView::OnInitialUpdate();x09//TODO:Addyourspecializedcodehereand/orcallthebaseclassx09CRectrcClient;】
问题描述:

errorC2679:binary'+'nooperatorfoundwhichtakesaright-handoperandoftype'constcha

voidCExampleViewView::OnInitialUpdate()

{

x09CView::OnInitialUpdate();

x09//TODO:Addyourspecializedcodehereand/orcallthebaseclass

x09CRectrcClient;

x09GetClientRect(rcClient);

x09if(m_ctrlEdit)deletem_ctrlEdit;

x09m_ctrlEdit=newCEdit();

x09m_ctrlEdit->Create(ES_MULTILINE|WS_CHILD|WS_VISIBLE|WS_HSCROLL|ES_AUTOHSCROLL|WS_VSCROLL|ES_AUTOVSCROLL,rcClient,this,201);

x09CExampleViewDoc*pDoc=GetDocument();

x09CStringstr;

x09intnLines=(int)pDoc->m_strContent.GetSize();

x09for(inti=0;im_strContent.GetAt(i);

x09x09str=str+"rn";

x09}

x09m_ctrlEdit->SetTabStops(16);

x09m_ctrlEdit->SetWindowText(str);

}

蒋俊树回答:
  这一句str = str + "rn";改成str = str + _T("rn");应该是由于开启了Unicode.所以CString内部类型实际是wchar_t而不是char,你在操作裸字符串的时候也...
点击显示
其它推荐
热门其它推荐
  • 其它