1.头文件中要定义宏;
#define UNICODE
#define _UNICODE
2.char转换成wchar
const char *pFilePathName = "c://aa.dll";
int nLen = strlen(pFilePathName) + 1;
int nwLen = MultiByteToWideChar(CP_ACP, 0, pFilePathName, nLen, NULL, 0);
TCHAR lpszFile[256];
MultiByteToWideChar(CP_ACP, 0, pFilePathName, nLen, lpszFile, nwLen);
3.wchar转换成char
char *pFilePathName;
TCHAR lpszFile[256];
_tcscpy(lpszFile, _T("c://aa.dll"));
int nLen = wcslen(wstr)+1;
WideCharToMultiByte(CP_ACP, 0, lpszFile, nLen, pFilePathName, 2*nLen, NULL, NULL);
4.char*和CString转换
CString 是一种很特殊的 C++ 对象,它里面包含了三个值:一个指向某个数据缓冲区的指针、一个是该缓冲中有效的字符记数(它是