原创 WideCharToMultiByte 将CString转为char

2011-9-18 01:34 1540 5 5 分类: 软件与OS
BOOL CAdoRecordSet::GetChunk(long index, CBitmap &bitmap)
{
CString str=GetFieldName(index);
int len = WideCharToMultiByte(CP_ACP,0,str,str.GetLength(),NULL,0,NULL,NULL);
char* pChar = new char[len+1];
WideCharToMultiByte(CP_ACP,0,str,str.GetLength()+1,pChar,len+1,NULL,NULL);
pChar[len+1]='/0';
// WideCharToMultiByte(CP_OEMCP,NULL,GetFieldName(index),-1,str,0,NULL,FALSE);
// MultiByteToWideChar(CP_ACP,MB_PRECOMP0SED,str,
return GetChunk(pChar, bitmap);
delete[] pChar;
}
PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
5
关闭 站长推荐上一条 /3 下一条