void CMfcReaderDlg::OnBnClickedButton1()
{
    // TODO:  在此添加控件通知处理程序代码
    UpdateData(TRUE);
    //using chinese character reader way.
    char* old_locale = _strdup(setlocale(LC_CTYPE, NULL));
    setlocale(LC_CTYPE, "chs");


    CStdioFile stdFile(L"test.txt", CFile::modeRead);
    CString strBuf;
    while(stdFile.ReadString(strBuf))
    {

        MessageBox(strBuf);

    }

    stdFile.Close();

    //release chinese character translation
    setlocale(LC_CTYPE, old_locale);
    free(old_locale);

}

Yang_River
156 声望7 粉丝

下一篇 »
编码问题

引用和评论

0 条评论