当前位置:网站首页>MFC CString to char*
MFC CString to char*
2022-07-02 14:56:00 【sam-zy】
/// <summary>
/// CString turn char*
/// </summary>
/// <param name="str"> Input CString type </param>
/// <returns> Converted char* type </returns>
char* CStringToCharArray(CString str)
{
int n;
n = WideCharToMultiByte(CP_OEMCP, 0, str, -1, NULL, 0, 0, FALSE); // Wide byte to multi byte
char* SendInt = new char[n];
memset(SendInt, 0, n * sizeof(char)); // initialization pSend
WideCharToMultiByte(CP_OEMCP, 0, str.GetBuffer(0), n, SendInt, n, 0, FALSE);
str.ReleaseBuffer(); // Release cache
return SendInt;
}
边栏推荐
- obsidian安装第三方插件——无法加载插件
- Bit by bit of OpenCV calling USB camera
- 2. Const pointer
- taobao.trade.get( 获取单笔交易的部分信息),淘宝店铺订单接口,淘宝oAuth2.0接口,淘宝R2接口代码对接分享
- threejs的控制器 立方体空间 基本控制器+惯性控制+飞行控制
- Fabric.js 动态设置字号大小
- Fabric.js 手动加粗文本iText
- 1、编辑利器vim
- info [email protected] : The platform “win32“ is incompatible with this module.
- Check password
猜你喜欢
随机推荐
Fabric.js 手动加粗文本iText
buuctf-pwn write-ups (7)
STM32标准固件库函数名记忆(二)
info [email protected] : The platform “win32“ is incompatible with this module.
NLA natural language analysis makes data analysis more intelligent
1、编辑利器vim
Introduction to mathjax (web display of mathematical formulas, vector)
LeetCode 2310. 个位数字为 K 的整数之和
MQ教程 | Exchange(交换机)
Li Chuang EDA learning notes 15: draw border or import border (DXF file)
Contrôleur pour threejs cube Space Basic Controller + Inertial Control + Flight Control
Ad20 cannot select the solution of component packaging in PCB editor
关于网页中的文本选择以及统计选中文本长度
Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022
Fabric.js 元素被选中时保持原有层级
Thoroughly master prototype__ proto__、 Relationship before constructor (JS prototype, prototype chain)
NLA natural language analysis realizes zero threshold of data analysis
Advanced usage of C language -- function pointer: callback function; Conversion table
Implement a server with multi process concurrency
华为面试题: 没有回文串




![[apipost] tutorial](/img/f9/717908a72720f152ad49034be64b35.png)



