当前位置:网站首页>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;
}
边栏推荐
- 电脑怎么设置扬声器播放麦克风的声音
- Makefile 分隔文件名与后缀
- Why can't browsers read JSX?
- C#代码审计实战+前置知识
- Check password
- LeetCode 209. 长度最小的子数组
- taobao. logistics. dummy. Send (no logistics delivery processing) interface, Taobao store delivery API interface, Taobao order delivery interface, Taobao R2 interface, Taobao oau2.0 interface
- taobao. trades. sold. Get query the transaction data that the seller has sold (according to the creation time), Taobao store sales order query API interface, Taobao R2 interface, Taobao oauth2.0 trans
- STM32-DAC实验&高频DAC输出测试
- Design and implementation of car query system based on php+mysql
猜你喜欢
天猫商品详情接口(APP,H5端)
Large top heap, small top heap and heap sequencing
There is no solution to the decryption error of the remote user 'sa' and the service master password mapped from the remote server 'to the local user' (null) /sa '
Actual combat sharing of shutter screen acquisition
kityformula-editor 配置字号和间距
mathML转latex
Tmall product details interface (APP, H5 end)
电脑怎么设置扬声器播放麦克风的声音
Pychart connects to the remote server
About text selection in web pages and counting the length of selected text
随机推荐
Understanding of mongodb
Fabric.js 元素被选中时保持原有层级
C语言中的printf函数和scanf函数
C#代码审计实战+前置知识
Yyds dry goods inventory software encryption lock function
What is erdma? Popular science cartoon illustration
Li Chuang EDA learning notes 15: draw border or import border (DXF file)
C#延时、在线程中开启定时器、获取系统时间
Actual combat sharing of shutter screen acquisition
About text selection in web pages and counting the length of selected text
Method of creating linked server for cross server data access
taobao.trade.memo.add( 对一笔交易添加备注 )接口,淘宝店铺插旗接口,淘宝订单插旗API接口,oAuth2.0接口
STM32标准固件库函数名(一)
OpenCV调用USB摄像头的点滴
MQ tutorial | exchange (switch)
Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
[QNX Hypervisor 2.2用户手册]6.3 Guest与外部之间通信
taobao.trade.get( 获取单笔交易的部分信息),淘宝店铺订单接口,淘宝oAuth2.0接口,淘宝R2接口代码对接分享
LeetCode 209. 长度最小的子数组
STM32库函数进行GPIO初始化