调试时出错指向此处 好像是MFC中的文件,“strcore.cpp" 好像是重载+吧
CString AFXAPI operator+(const CString& string1, const CString& string2)
{
CString s;
s.ConcatCopy(string1.GetData()->nDataLength, string1.m_pchData,
string2.GetData()->nDataLength, string2.m_pchData);
return s;
}
我的程序中用到了例如
CSting sp;
sp=sp+"123";
是什么原因造成出错的,大家帮帮,先谢了。
CString AFXAPI operator+(const CString& string1, const CString& string2)
{
CString s;
s.ConcatCopy(string1.GetData()->nDataLength, string1.m_pchData,
string2.GetData()->nDataLength, string2.m_pchData);
return s;
}
我的程序中用到了例如
CSting sp;
sp=sp+"123";
是什么原因造成出错的,大家帮帮,先谢了。
解决方案 »
- 关于网络资源搜索
- 如何去掉或者动态修改工具栏按钮的提示信息?
- 谁能给我个软件设计文档,要有UML之类的图的
- 一个客户端连接发起30几万次连接后,再连接时出现连接不上服务器的问题
- 请问怎么用VS2008做一个制作台程序?
- One or more breakpoint cannot be set and have been disabled.Execution will stop at the beginning of the program
- 怎样在SDI结构中使用静态拆分?
- 请教:如何在基于Dialog的VC程序中Insert 工具条?---初学者的困惑
- stamptime格式的时间字符串如何转化为标准时间格式?
- 如果把 vpacket.vxd 的源码全部弄懂会如何?
- 如何通过ReadProcessMemory来读取别的程序的内存中的数据?
- 问一个编译的时候跟ddk有关的问题
操作符+的两个操作对象都是CString,而你的“123”不是CString
If I call the code like this:
CSting sp;
sp=sp+CString("123");
The override operator was invoked and also worked fine;In VC8.0, your writings is not supported yet. The correct way should be as follows:
CString AFXAPI operator+(const CString& string1, const CString& string2)
{
CString s;
s.Insert(0,string1.GetString());
s.Insert(string1.GetLength(),string2.GetString());
return s;
}