How to add a newline with SetWindowText() in ReadOnly CEdit? "\n" doesn't work :(
I made some simple log window out of CEdit control. It is read only , or i would say output only. User cannot input text, only see logging. But program must be able to write text out to this console. I use GetWindowText() and SetWindowText() as described. And newline is supposed to be done by adding "\n" at the end of lines, doesn't it ??? Well it doesn't work with CEdit. It prints out some strange "l" or "i" symbol instead of a newline... Any clue? Logging is supposed to be multilined, you know
Re: How to add a newline with SetWindowText() in ReadOnly CEdit? "\n" doesn't work :
Just to complete the answers already posted, have a look in this FAQ: How to append text to an edit control?
If you want add lines to a multiline edit control, it's much better to use CEdit::SetSel and CEdit::ReplaceSel instead of CWnd::GetWindowText and CWnd::SetWindowText.