Hi all,

i need to open a text file and display the content in the listbox, i use the following code:

Code:
string line;
ostringstream out;
  ifstream myfile ("D:\\text.txt");
  if (myfile.is_open())
  {
    while (! myfile.eof() )
    {
      getline (myfile,line);
      out << line << endl;
	  string line2 = out.str();

	  CString line3 = line2.c_str();

DetailValue.AddString(line3);
}
}
but i can't convert const char* into CString , how to do it?

also any other method to read text file into listbox or editbox which is easier?
thx!