VS2010 CString末尾加回车换行
来源:互联网 发布:apt模型与capm模型知乎 编辑:程序博客网 时间:2024/05/22 06:40
之前的代码是
CString str;//str+="\r\n";str+=(wchcar_t)"\r\n";str+=(char)"\r\n";
都不行,乱码。
后来改为:
CString str;str=str+(char)0x0d;str=str+(char)0x0a;
下面部分是网上摘抄:
在CString中不能直接访问指定位置的字符,所有要GetBuffer获得字符串指针,然后在字符串末尾添加回车、换行字符(回车的ASCII码是13,换行的ASCII码是10);
例子代码:
CString strTemp;
LPTSTR pStr;
int nLen=strTemp.GetLength();
pStr=strTemp.GetBuffer(nLen+2);
pStr[nLen]=13;
pStr[nLen+1]=10;
strTemp.ReleaseBuffer();
0 0
- VS2010 CString末尾加回车换行
- ABAP中操作回车、换行、回车加换行、的方案
- angular 回车事件(回车发送,回车加ctrl 换行)
- [javascript]多行TextBox回车换行,光标移到最末尾
- 给.h .cpp文件批量在文件末尾加换行
- 为CString 类型数据添加回车换行符!
- 回车换行
- 回车 换行
- 回车换行
- 回车换行
- 回车换行
- 回车换行
- 回车 换行
- 回车,换行
- 回车 & 换行
- 回车 换行
- 回车 换行
- 换行 回车
- 为apt-get设置http代理
- VC++常见错误原因解析--error LNK2019: 无法解析的外部符号 "public: void __thiscall
- Servlet生命周期与工作原理
- LeetCode Two Sum
- 年终总结---花谢花开续
- VS2010 CString末尾加回车换行
- 上下文切换
- 扫一扫地产广告便可直接从平板上看到可交互的房屋3D模型,地产AR模型提供商Virtual View获50万美元天使投资
- Tea 任何长度数据加密的一个实现
- Android学习之——APP番茄工作法——小结(2)
- 嵌入式Linux C笔试题积累
- 【lint】Android Lint简介
- DM365 uboot参数对应模块 module_param
- ArcGIS如何获取影像的像素值