Hi,
It is very likely that your file is ANSI and not UNICODE, in that case you should read it into an ANSI string.
[Edited after OP comment]
See
The Complete Guide to C++ Strings, Part I - Win32 Character Encodings[
^] and part 2, for string handling tutorial.
eVC4 MFC does not support
CStringA
and
CStringW
, so you have to handle ANSI strings with the
Standard C++ Library, and convert to UNICODE before calling
CEdit
. The following compiles OK with VS2008, hopefully will do it with eVC:
#include <fstream>
#include <string>
inline void Test()
{
std::ifstream in(_T("\\ResidentFlash\\text.txt"));
std::string line;
std::getline(in, line);
CString strEdit(line.c_str());
CEdit * pEdit = (CEdit *)GetDlgItem(IDC_EDIT1);
pEdit->SetWindowText(strEdit + _T("test"));
}
[/Edit]
Try to copy a UNICODE file to your device, your program should read it.
cheers,
AR