当前位置:网站首页>MFC CString 转 char*
MFC CString 转 char*
2022-07-02 11:41:00 【sam-zy】
/// <summary>
/// CString 转 char*
/// </summary>
/// <param name="str">输入CString类型</param>
/// <returns>转换后的char*类型</returns>
char* CStringToCharArray(CString str)
{
int n;
n = WideCharToMultiByte(CP_OEMCP, 0, str, -1, NULL, 0, 0, FALSE); //宽字节转多字节
char* SendInt = new char[n];
memset(SendInt, 0, n * sizeof(char)); //初始化pSend
WideCharToMultiByte(CP_OEMCP, 0, str.GetBuffer(0), n, SendInt, n, 0, FALSE);
str.ReleaseBuffer(); //释放缓存
return SendInt;
}
边栏推荐
- STM32库函数进行GPIO初始化
- 【空间&单细胞组学】第1期:单细胞结合空间转录组研究PDAC肿瘤微环境
- 关于网页中的文本选择以及统计选中文本长度
- STM32标准固件库函数名记忆(二)
- Fabric. JS zoom canvas
- mathjax 入门(web显示数学公式,矢量的)
- Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
- Development and design of animation surrounding mall sales website based on php+mysql
- Database connection pool and data source
- 没有从远程服务器‘‘映射到本地用户‘(null)/sa‘的远程用户‘sa‘及服务主密码解密错误的解决办法
猜你喜欢

Large top heap, small top heap and heap sequencing

复用和分用

ONNX+TensorRT:将预处理操作写入ONNX并完成TRT部署

LeetCode 2310. 个位数字为 K 的整数之和

什么是 eRDMA?丨科普漫画图解

Uniapp automated test learning

obsidian安装第三方插件——无法加载插件

实现一个多进程并发的服务器

Edit the formula with MathType, and set it to include only mathjax syntax when copying and pasting

Development and design of animation surrounding mall sales website based on php+mysql
随机推荐
Fatal: unsafe repository is owned by someone else
Socket and socket address
STM32-DAC实验&高频DAC输出测试
Available solution development oral arithmetic training machine / math treasure / children's oral arithmetic treasure / intelligent math treasure LCD LCD driver ic-vk1622 (lqfp64 package), original te
一张图彻底掌握prototype、__proto__、constructor之前的关系(JS原型、原型链)
threejs的控制器 立方體空間 基本控制器+慣性控制+飛行控制
ONNX+TensorRT:将预处理操作写入ONNX并完成TRT部署
MathML to latex
Thoroughly master prototype__ proto__、 Relationship before constructor (JS prototype, prototype chain)
Advanced C language (learn malloc & calloc & realloc & free in simple dynamic memory management)
Advanced usage of C language -- function pointer: callback function; Conversion table
qml 弹窗框架,可定制
Chapter 9: xshell free version installation
Ad20 cannot select the solution of component packaging in PCB editor
Certik released the defi security report in 2021, disclosing key data of industry development (PDF download link attached)
没有从远程服务器‘‘映射到本地用户‘(null)/sa‘的远程用户‘sa‘及服务主密码解密错误的解决办法
kityformula-editor 配置字号和间距
用户隐私协议有些汉字编码不规范导致网页显示乱码,需要统一找出来处理一下
Introduction to mathjax (web display of mathematical formulas, vector)
Edit the formula with MathType, and set it to include only mathjax syntax when copying and pasting