[Dev-C++] error in new line EDIT control
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Noorez K. <lor...@ho...> - 2005-06-08 05:09:10
|
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!
|