#include <windows.h>
#include <shellapi.h>
#include <iostream>
#include <atlstr.h>
#include <fstream>
using namespace std;
char与CString互相转换
//char转CString
char str1[132]="12345";
CString str2(str1);
//CString转char
void CString2Char(CString str, char ch[])
{
int i;
char *tmpch;
int wLen = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);//得到Char的长度
tmpch = new char[wLen + 1]; //分配变量的地址大小
WideCharToMultiByte(CP_ACP, 0, str, -1, tmpch, wLen, NULL, NULL); //将CString转换成char*
for(i = 0; tmpch[i] != '\0'; i++) ch[i] = tmpch[i];
ch[i] = '\0';
}
CString cstr1 = _T("ASDDSD");
char chArray[100];
CString2Char(cstr1,chArray); //CString转char
uc1601(chArray,1);