Did you test \r\n in the edit box?
Reading a text file "as text" only loads a \n into memory.
/Per W
On Tue, 7 Jun 2005, Noorez Kassam wrote:
> In my file handling, I'm ending up with something like this when I attempt
> to read from a text file and print it out to an EDIT control: Hello|how are
> you today. Instead of the new line in the EDIT, I get a small black line.
> Hear is the function...
>
> void OpenText(HWND main)
> {
> char lpstrFile[256];
>
> char inLine[256];
> inLine[0] = '\0';
>
> char buffer[5000];
> buffer[0] = '\0';
>
> LPOPENFILENAME openFileInfo = new OPENFILENAME;
>
> getOFNproperties(main, openFileInfo, lpstrFile);
>
> if( !GetOpenFileName(openFileInfo) )
> {
> MessageBox(main,"Could Not Open","ERROR",MB_OK | MB_ICONERROR);
> return;
> }
>
> ifstream openTextFile(openFileInfo->lpstrFile);
>
> while( !openTextFile.eof() )
> {
> openTextFile.getline(inLine,500);
> //MessageBox(main,inLine,"Message", MB_OK);
> strcat(buffer,inLine);
> }
>
> SetDlgItemText(main, IDC_MAIN_EDIT, buffer);
>
> delete openFileInfo;
> }
>
> I also attached the whole program
>
> _________________________________________________________________
> Don't just Search. Find! http://search.sympatico.msn.ca/default.aspx The new
> MSN Search! Check it out!
>
|