//vs 2010 开发涉及到类型CString转Char*的问题
bool CCsToolDlg::CStringToChar(CString pstr,char * ch,int len)
{
if(pstr.GetLength()>len) return false;
int strlen=pstr.GetLength();
int nbyte=WideCharToMultiByte(CP_ACP,0,pstr,strlen,NULL,0,NULL,NULL);
char * VoicePath=new char[nbyte+1];
memset(VoicePath,0,nbyte+1);
WideCharToMultiByte(CP_OEMCP,0,pstr,strlen,VoicePath,nbyte,NULL,NULL);
VoicePath[nbyte]=0;
memcpy(ch,VoicePath,nbyte+1);
delete []VoicePath;
return true;
}