你的工程使用的是unicode字节么?

解决方案 »

  1.   

    CString str1;
    str1=_T("../测试成绩/")+m_strName+_T(".txt");//给txt起名字
    CFile file1(str1,?CFile::modeReadWrite|CFile::modeCreate);
    char prefix[2] = {0xff, 0xfe};//Unicode文件头
    file1.Write(prefix, 2);
    file1.Write(str.GetBuffer(),str.GetLength()*sizeof(TCHAR));  
    file1.Close();
      

  2.   


    你这个肯定不对啊,WRITE都不是Cfile的成员函数,我指的是用CArchive类写
      

  3.   

    参考:http://msdn.microsoft.com/en-US/library/esb6sz20(v=vs.80).aspx
      

  4.   

    你试下把工程属性里的Character set设定为not set,我试了可以