Click here to Skip to main content
15,798,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem in getting strings with space. Pin
Anu_Bala24-Jan-06 17:49
Anu_Bala24-Jan-06 17:49 
AnswerRe: Problem in getting strings with space. Pin
_AnsHUMAN_ 24-Jan-06 17:57
_AnsHUMAN_ 24-Jan-06 17:57 
AnswerRe: Problem in getting strings with space. Pin
Laxman924-Jan-06 18:09
Laxman924-Jan-06 18:09 
GeneralRe: Problem in getting strings with space. Pin
David Crow25-Jan-06 6:17
David Crow25-Jan-06 6:17 
AnswerRe: Problem in getting strings with space. Pin
MANISH RASTOGI24-Jan-06 18:43
MANISH RASTOGI24-Jan-06 18:43 
AnswerRe: Problem in getting strings with space. Pin
toxcct24-Jan-06 22:39
toxcct24-Jan-06 22:39 
AnswerRe: Problem in getting strings with space. Pin
_anil_25-Jan-06 3:13
_anil_25-Jan-06 3:13 
AnswerRe: Problem in getting strings with space. Pin
David Crow25-Jan-06 6:24
David Crow25-Jan-06 6:24 
While you may get it to work, your code is not very efficient as it reads from the disk way too often. If all you are doing is reading from a file and displaying the contents in an edit control (i.e., you wanted words and spaces), I suggest something like:

CFile file("c:\\log.txt", CFile::modeRead);
LPBYTE lpBuffer = new BYTE[file.GetLength() + 1];
UINT uBytesRead = file.Read(lpBuffer, file.GetLength());
lpBuffer[uBytesRead] = '\0';
file.Close();
m_Text.SetWindowText(lpBuffer); // assuming that m_Text is a CEdit variable
// no need to use UpdateData()


"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb


GeneralRe: Problem in getting strings with space. Pin
cpp_prgmer25-Jan-06 22:38
cpp_prgmer25-Jan-06 22:38 
GeneralRe: Problem in getting strings with space. Pin
David Crow26-Jan-06 3:48
David Crow26-Jan-06 3:48 
Questionhow to make a file use unicode in windows 98?? Pin
ebinaini24-Jan-06 16:19
ebinaini24-Jan-06 16:19 
AnswerRe: how to make a file use unicode in windows 98?? Pin
Prakash Nadar24-Jan-06 19:15
Prakash Nadar24-Jan-06 19:15 
AnswerRe: how to make a file use unicode in windows 98?? Pin
<color>Aljechin 24-Jan-06 20:38
<color>Aljechin 24-Jan-06 20:38 
QuestionRe: how to make a file use unicode in windows 98?? Pin
David Crow25-Jan-06 6:29
David Crow25-Jan-06 6:29 
Questionhow to make a window always stay on the top Pin
the Jimmy24-Jan-06 14:40
the Jimmy24-Jan-06 14:40 
AnswerRe: how to make a window always stay on the top Pin
Axonn Echysttas24-Jan-06 14:43
Axonn Echysttas24-Jan-06 14:43 
GeneralRe: how to make a window always stay on the top Pin
the Jimmy24-Jan-06 17:04
the Jimmy24-Jan-06 17:04 
GeneralRe: how to make a window always stay on the top Pin
Axonn Echysttas24-Jan-06 20:43
Axonn Echysttas24-Jan-06 20:43 
GeneralRe: how to make a window always stay on the top Pin
the Jimmy24-Jan-06 21:53
the Jimmy24-Jan-06 21:53 
GeneralRe: how to make a window always stay on the top Pin
Axonn Echysttas24-Jan-06 22:51
Axonn Echysttas24-Jan-06 22:51 
Questionfloat to binary Pin
P1P3R24-Jan-06 13:24
P1P3R24-Jan-06 13:24 
AnswerRe: float to binary Pin
Joshua Quick24-Jan-06 13:37
Joshua Quick24-Jan-06 13:37 
GeneralRe: float to binary Pin
P1P3R24-Jan-06 16:22
P1P3R24-Jan-06 16:22 
GeneralRe: float to binary Pin
Joshua Quick24-Jan-06 16:29
Joshua Quick24-Jan-06 16:29 
GeneralRe: float to binary Pin
P1P3R24-Jan-06 16:38
P1P3R24-Jan-06 16:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.