当前位置:网站首页>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;
}
边栏推荐
- Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
- YoloV6训练:训练自己数据集遇到的各种问题
- 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
- 实现一个多进程并发的服务器
- Reuse and distribution
- Fatal: unsafe repository is owned by someone else
- Tujia muniao meituan has a discount match in summer. Will it be fragrant if the threshold is low?
- Yyds dry goods inventory software encryption lock function
- STM32-DAC实验&高频DAC输出测试
- 【NOI模拟赛】伊莉斯elis(贪心,模拟)
猜你喜欢
关于网页中的文本选择以及统计选中文本长度
MathML to latex
Introduction to mathjax (web display of mathematical formulas, vector)
LeetCode 209. 长度最小的子数组
Ad20 cannot select the solution of component packaging in PCB editor
Xilinx Vivado set *. svh as SystemVerilog Header
[email protected] : The platform “win32“ is incompatible with this module."/>
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
Large top heap, small top heap and heap sequencing
没有从远程服务器‘‘映射到本地用户‘(null)/sa‘的远程用户‘sa‘及服务主密码解密错误的解决办法
随机推荐
STM32 standard firmware library function name memory (II)
【无标题】LeetCode 2321. 拼接数组的最大分数
[apipost] tutorial
关于网页中的文本选择以及统计选中文本长度
<口算練習機 方案開發原理圖>口算練習機/口算寶/兒童數學寶/兒童計算器 LCD液晶顯示驅動IC-VK1621B,提供技術支持
求轮廓最大内接圆
Onnx+tensorrt: write preprocessing operations to onnx and complete TRT deployment
【题解】Educational Codeforces Round 82
4. Array pointer and pointer array
Fabric. Usage of JS eraser (including recovery function)
Fabric.js 元素被选中时保持原有层级
Fabric.js 自由绘制椭圆
[Space & single cellomics] phase 1: single cell binding space transcriptome research PDAC tumor microenvironment
taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface
Delete element (with transition animation)
Thoroughly master prototype__ proto__、 Relationship before constructor (JS prototype, prototype chain)
Fabric. JS zoom canvas
Add vector formula in rich text editor (MathType for TinyMCE, visual addition)
JMeter script parameterization
Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly