std::string ws2s(const std::wstring& str)
{
char* pElementText;
int iTextLen;
// wide char to multi char
iTextLen = WideCharToMultiByte(CP_ACP, , str.c_str(), -, NULL, , NULL, NULL);
pElementText = new char[iTextLen + ];
memset((void*)pElementText, , sizeof(char)* (iTextLen + ));
::WideCharToMultiByte(CP_ACP, , str.c_str(), -, pElementText, iTextLen, NULL, NULL);
std::string strText;
strText = pElementText;
delete[] pElementText;
return strText;
}
std::string strKEy = ws2s(pKey);//pKey为WCHAR类型
char pStr[] = {};
strcpy_s(pStr, , strKEy.c_str());

最新文章

  1. 纯JSP实现简单登录跳转
  2. 答CsdnBlogger问-关于定时和后台服务问题
  3. @ControllerAdvice
  4. 编译安装-Nginx
  5. 源码分析:静态分析 C 程序函数调用关系图
  6. http错误码大全
  7. Bloglines订阅Blog部落格RSS网摘 - Blog透视镜
  8. 歪国人DIY的MINI四轴
  9. [CQOI2007]余数求和
  10. (poj 2502) Subway 最短路
  11. Django模型操作常用方法
  12. day52 js--- bom dom
  13. maya2018卸载/安装失败/如何彻底卸载清除干净maya2018注册表和文件的方法
  14. html-标签页
  15. MySQL中的运算符和时间运算
  16. Django-类视图与中间件
  17. Introduction to the Optimizer --cbo
  18. class() 高级用法 -- lua
  19. 『PyTorch x TensorFlow』第八弹_基本nn.Module层函数
  20. 三个和数组有关的程序题目(C++)

热门文章

  1. WPF系列教程——(三)使用Win10 Edge浏览器内核 - 简书
  2. 获取HTTP请求头中的地址
  3. 线性表(List)
  4. 大数据服务大比拼:AWS VS. AzureVS.谷歌
  5. python考点
  6. 《Cracking the Coding Interview》——第11章:排序和搜索——题目2
  7. 《数据结构》C++代码 Splay
  8. 【Pascal's Triangle II 】cpp
  9. python基础实践(二)
  10. Python学习1,代码