当前位置:网站首页>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;
}
边栏推荐
- Factal: Unsafe repository is owned by someone else Solution
- 电脑怎么设置扬声器播放麦克风的声音
- LeetCode - 搜索二维矩阵
- Pychart connects to the remote server
- 【空间&单细胞组学】第1期:单细胞结合空间转录组研究PDAC肿瘤微环境
- taobao.trade.memo.add( 对一笔交易添加备注 )接口,淘宝店铺插旗接口,淘宝订单插旗API接口,oAuth2.0接口
- Fabric. JS dynamically set font size
- [Space & single cellomics] phase 1: single cell binding space transcriptome research PDAC tumor microenvironment
- Tujia muniao meituan has a discount match in summer. Will it be fragrant if the threshold is low?
- info [email protected] : The platform “win32“ is incompatible with this module.
猜你喜欢

taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface

About text selection in web pages and counting the length of selected text

What is erdma? Popular science cartoon illustration

【空间&单细胞组学】第1期:单细胞结合空间转录组研究PDAC肿瘤微环境

蜻蜓低代码安全工具平台开发之路

Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022

kityformula-editor 配置字号和间距

LeetCode 209. 长度最小的子数组

C#代码审计实战+前置知识

电脑怎么设置扬声器播放麦克风的声音
随机推荐
求轮廓最大内接圆
Fabric. JS manual bold text iText
删除元素(带过渡动画)
C语言中的printf函数和scanf函数
华为面试题: 没有回文串
MQ教程 | Exchange(交换机)
Stm32-dac Experiment & high frequency DAC output test
jmeter脚本参数化
A white hole formed by antineutrons produced by particle accelerators
kityformula-editor 配置字号和间距
forEach的错误用法,你都学废了吗
Development and design of animation surrounding mall sales website based on php+mysql
Simple verification code generator for 51 single chip microcomputer experiment
PTA题库 ===>复数四则运算,一帮一,考试座位号(7-73)
PTA question bank== > complex four operations, one for one, examination seat number (7-73)
电脑怎么设置扬声器播放麦克风的声音
Uniapp automated test learning
Tip: SQL Server blocked the state 'openrowset/opendatasource' of component 'ad hoc distributed queries'
Yyds dry goods inventory software encryption lock function
LeetCode - 搜索二维矩阵