博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C++string与VC++CString互转
阅读量:7115 次
发布时间:2019-06-28

本文共 1124 字,大约阅读时间需要 3 分钟。

hot3.png

//CString to stringstring CStringToString(const CString &cstr){    string str=cstr.GetBuffer(0);    cstr.ReleaseBuffer();    return str;}void CStringToStringEx(const CString &cstr, string &str){    str=cstr.GetBuffer(0);    cstr.ReleaseBuffer();}//string to CStringCString StringToCString(const string &str){    CString cstr=str.c_str();    return cstr;}void StringToCStringEx(const string &str, CString &cstr){    cstr=str.c_str();}//CStringA to stringstring CStringAToString(const CStringA &cstra){    string str=cstra.GetBuffer(0);    cstra.ReleaseBuffer();    return str;}void CStringAToStringEx(const CStringA &cstra, string &str){    str=cstra.GetBuffer(0);    cstra.ReleaseBuffer();}//CStringW to stringstring CStringWToString(const CStringW &cstrw){    CStringA ctsra(cstrw.GetBuffer(0));    cstrw.ReleaseBuffer();    string str=cstra.GetBuffer(0);    cstra.ReleaseBuffer();    return str;}void CStringWToStringEx(const CStringW &cstrw, string &str){    CStringA ctsra(cstrw.GetBuffer(0));    cstrw.ReleaseBuffer();    str=cstra.GetBuffer(0);    cstra.ReleaseBuffer();}

转载于:https://my.oschina.net/u/186539/blog/63949

你可能感兴趣的文章
vue使用qrcode插件生成二维码
查看>>
swig模板 html代码自然状态下输出是转义的,必须加一个函数来转换为html代码;...
查看>>
课上练习
查看>>
android studio 中获取sha1
查看>>
兼容主流浏览器的CSS透明代码
查看>>
sql
查看>>
GO语言的进阶之路-网络安全之proxy
查看>>
人是怎么废掉的?
查看>>
vim编辑器使用
查看>>
高精度算法集合
查看>>
MyEclipse中消除frame引起的“the file XXX can not be found.Please check the location and try again.”的错误...
查看>>
Mysql InnoDB三大特性-- change buffer
查看>>
TCP、UDP、RTP(RTCP)异同与区别
查看>>
Linux的文件最大连接数
查看>>
文章标题
查看>>
JAVA线程
查看>>
用for和while循环求e的值[e=1+1/1!+1/2!+1/3!+1/4!+1/5!+...+1/n!]
查看>>
压缩跟踪(CT)代码具体学习_模块1(样本的採集和扩充)
查看>>
硬盘写入 iso
查看>>
Linux学习日记——字符处理
查看>>