当前位置:网站首页>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;
}
边栏推荐
- C#延时、在线程中开启定时器、获取系统时间
- info [email protected]: The platform “win32“ is incompatible with this module.
- Yyds dry goods inventory software encryption lock function
- 1、编辑利器vim
- Kityformula editor configure font size and spacing
- Reuse and distribution
- Li Chuang EDA learning notes 15: draw border or import border (DXF file)
- 【NOI模拟赛】伊莉斯elis(贪心,模拟)
- LeetCode_滑动窗口_中等_395.至少有 K 个重复字符的最长子串
- Advanced C language (realize simple address book)
猜你喜欢

Implement a server with multi process concurrency

Reuse and distribution

一张图彻底掌握prototype、__proto__、constructor之前的关系(JS原型、原型链)

MQ教程 | Exchange(交换机)

Fabric. JS upper dash, middle dash (strikethrough), underline

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

Onnx+tensorrt: write preprocessing operations to onnx and complete TRT deployment

Advanced C language (realize simple address book)

Large top heap, small top heap and heap sequencing

途家木鸟美团夏日折扣对垒,门槛低就一定香吗?
随机推荐
LeetCode 2310. 个位数字为 K 的整数之和
[Space & single cellomics] phase 1: single cell binding space transcriptome research PDAC tumor microenvironment
Fabric. Keep the original level when JS element is selected
Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
Database connection pool and data source
Fabric.js 橡皮擦的用法(包含恢复功能)
tmall.product.schema.get( 产品信息获取schema获取 ),淘宝店铺上传商品API接口,淘宝商品发布接口,淘宝商品上传API接口,店铺上传接口,oAuth2.0接口
Fatal: unsafe repository is owned by someone else
电脑怎么设置扬声器播放麦克风的声音
Thoroughly master prototype__ proto__、 Relationship before constructor (JS prototype, prototype chain)
Threejs controller cube space basic controller + inertia control + flight control
taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface
报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
buuctf-pwn write-ups (7)
Delete element (with transition animation)
info [email protected] : The platform “win32“ is incompatible with this module.
广州市应急管理局发布7月高温高湿化工安全提醒
qml 弹窗框架,可定制
uniapp自动化测试学习
Factal: Unsafe repository is owned by someone else Solution