文本--->多字节

在 led屏幕的软件中的程序:

CString strTextContent;
m_RichEdit.GetWindowText(strTextContent);//获取文本内容
DWORD dwNum = WideCharToMultiByte(CP_OEMCP,NULL,strTextContent,-1,NULL,NULL,0,NULL);//文本字符转成多字节,返 
回字节数.
char *TextContent = new char[dwNum];//创建文本内容 字符数组
WideCharToMultiByte(CP_OEMCP,NULL,strTextContent,-1,TextContent,dwNum,0,NULL);//字符转字节: 将TextContent保 
存到TextContent中.

多字符  ---》多字节  数据的转换。    文本--->字节 

发现自己的不足,善于利用找到的方法去扬长避短。行动起来。
原文地址:https://www.cnblogs.com/rechen/p/5076191.html