//std::string => CString
std::string srcString = "Hello World!";
CString dstString = CString(srcString.c_str()); //std::string => CString
std::string srcString = "Hello World!";
USES_CONVERSION;
CString dstString = A2W(srcString.c_str()); //CString => std::string
CString srcString = CString("Hello World!");
std::string dstString = (CStringA)srcString; //CString => std::string
#include <atlconv.h>
CString srcString = CString("Hello World!");
USES_CONVERSION;
std::string dstString = W2A(srcString); AfxMessageBox(string);

BSTR 类型转换

BSTR result;
std::wstring stringResult = (_bstr_t)result; BSTR dst = (_bstr_t)stringResult .c_str();

最新文章

  1. 【转发】关于Java性能的9个谬论
  2. iOS开发拓展篇—UIDynamic(简单介绍)
  3. Big Number--hdu1018(数学)
  4. Java BTrace实战(1)--BTrace的入门和使用
  5. Careercup - Google面试题 - 6271724635029504
  6. linux 入侵检查转载
  7. PB+MS SQL+触发器必须指出
  8. VS2010下C/C++连接MySql数据库的方法
  9. C语言之循环结构 for(一)
  10. 远程连接mysql8.0,Error No.2058 Plugin caching_sha2_password could not be loaded
  11. BZOJ 3687: 简单题 bitset
  12. gridcontrol 添加行删除行
  13. Tomcat Cluster
  14. mysql&#183;事务挂起
  15. Confluence 6 自定义主面板
  16. 【NPM】npm ERR! Unexpected end of JSON input while parsing near &#39;...&quot;,&#39;解决方案
  17. 用Lucene4.5对中文文本建立索引
  18. python基础学习Day8 文件的基本操作
  19. Solr的搭建
  20. 【代码笔记】iOS-SDWebImage的使用

热门文章

  1. 爬虫_网页url设计
  2. Python输出hello world(各行命令详解)
  3. java 中字符串比较equals()和equalsIgnoreCase()的区别
  4. 申请9位数QQ
  5. 网页窗口logo图标设置
  6. java根据模板导出pdf
  7. win7:你需要来自Administrators的权限才能对此文件进行修改的一个文件
  8. [DeeplearningAI笔记]神经网络与深度学习3.2_3.11(激活函数)浅层神经网络
  9. spring之setter注入
  10. linux 基础信息查询