当前位置:网站首页>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;
}
边栏推荐
- jmeter脚本参数化
- Ad20 cannot select the solution of component packaging in PCB editor
- Li Chuang EDA learning notes 15: draw border or import border (DXF file)
- 3、函数指针和指针函数
- socket(套接字)与socket地址
- C code audit practice + pre knowledge
- ONNX+TensorRT:将预处理操作写入ONNX并完成TRT部署
- Onnx+tensorrt: write preprocessing operations to onnx and complete TRT deployment
- 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 '
- Fabric. JS free draw circle
猜你喜欢

实现一个多进程并发的服务器
![[apipost] tutorial](/img/f9/717908a72720f152ad49034be64b35.png)
[apipost] tutorial

Yolov6 training: various problems encountered in training your dataset

< schéma de développement de la machine d'exercice oral > machine d'exercice oral / trésor d'exercice oral / trésor de mathématiques pour enfants / lecteur LCD de calculatrice pour enfants IC - vk1621

kityformula-editor 配置字号和间距

【apipost】使用教程

Ad20 cannot select the solution of component packaging in PCB editor

没有从远程服务器‘‘映射到本地用户‘(null)/sa‘的远程用户‘sa‘及服务主密码解密错误的解决办法

buuctf-pwn write-ups (7)
![[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)](/img/08/9f25515e600a3174340b2589c81b0e.jpg)
[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)
随机推荐
MathML to latex
qml 弹窗框架,可定制
Advanced C language (realize simple address book)
华为面试题: 没有回文串
用户隐私协议有些汉字编码不规范导致网页显示乱码,需要统一找出来处理一下
Contrôleur pour threejs cube Space Basic Controller + Inertial Control + Flight Control
PTA question bank== > complex four operations, one for one, examination seat number (7-73)
什么是 eRDMA?丨科普漫画图解
Yyds dry goods inventory software encryption lock function
Obsidian installs third-party plug-ins - unable to load plug-ins
【apipost】使用教程
数据库连接池和数据源
mathML转latex
Edit the formula with MathType, and set it to include only mathjax syntax when copying and pasting
Factal: Unsafe repository is owned by someone else Solution
A white hole formed by antineutrons produced by particle accelerators
Fabric.js 橡皮擦的用法(包含恢复功能)
LeetCode 2310. 个位数字为 K 的整数之和
Quick analysis: easy to share the Internet
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