电子大神的日记本,供应链专家的功夫茶盘,在这里记录、分享与共鸣。

登录以开始

WideCharToMultiByte 将CString转为char

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;

}

博主
tony23
tony23's Blog
tony23