CString 转化为char*
int n = cstr.GetLength();
int len =WideCharToMultiByte(CP_ACP,0,cstr,cstr.GetLength(),NULL,0,NULL,NULL);
char * p = new char[len+1];
WideCharToMultiByte(CP_ACP,0,cstr,cstr.GetLength() + 1 ,p,len+ 1 ,NULL,NULL);
p[len+1]= '/0';
char* 转化为CString
void charToCString(char * ch, CString &cstr)
{
int nLen = strlen(ch) + 1;
int nwLen = MultiByteToWideChar(CP_ACP, 0, ch, nLen, NULL, 0);
TCHAR lp[256];
MultiByteToWideChar(CP_ACP, 0, ch, nLen, lp, nwLen);
cstr = lp;
}