16,472
社区成员
发帖
与我相关
我的任务
分享
if (bIsUnicode)
{
// char chr[100];
// ZeroMemory(chr, 100);
TCHAR tchr[50];
ZeroMemory(tchr, 50*sizeof(TCHAR));
m_f.Read(tchr, 50);
AfxMessageBox(tchr);
return;
}else{
// CString strText;
// m_f.ReadString(strText);
//strText.Format(_T("%s"), (LPTSTR)achr);
char chr[100];
ZeroMemory(chr, 100);
m_f.Read((LPTSTR)chr, 99);
TCHAR tchr[50];
MultiByteToWideChar( CP_ACP, 0, chr,
-1, tchr,
sizeof(tchr)/sizeof(tchr[0]) );
/*sizeof(tchr)/sizeof(tchr[0]) 这个算出来是50,也就是TCHAR tchr[50];这儿申明的大小*/
AfxMessageBox(tchr);
return;
}