BOOL CRDlg::WCharToMByte(LPCWSTR lpcwszStr, LPSTR lpszStr, DWORD dwSize)
{
DWORD dwMinSize;
dwMinSize = WideCharToMultiByte(CP_OEMCP,NULL,lpcwszStr,-1,NULL,0,NULL,FALSE);
if(dwSize+1 < dwMinSize)
{
return FALSE;
}
WideCharToMultiByte(CP_OEMCP,NULL,lpcwszStr,-1,lpszStr,dwSize,NULL,FALSE);
return TRUE;
}
CString csSum = T("count");
char cCountSum[15];
memset(cCountSum,0,sizeof(cCountSum));
WCharToMByte(csSum,(LPSTR)cCountSum,sizeof(cCountSum)/sizeof(cCountSum[0]));