char* convertCStringToChars(CString string) { int nLength=string.GetLength(); char *c=new char[nLength+1]; memset(c,0,nLength+1); WideCharToMultiByte(CP_ACP,0,string,nLength,c,nLength,NULL,NULL); return c; }