Click here to Skip to main content
15,890,982 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am using MFC Application, Editor provided for display, I have encountered the problem of
When I type text and copy text from editor to Notepad, the text is illegible.

As per Information. The End of Line is CRLF in windows and LF in Unix varaints, but, even though necessary EOL updations are made,

E
C++
<sendmessage(sci_seteolmode,2,0);>


the above is sendmessage provided in scintilla editor(ScintillaWnd.cpp MFC wrapper), and necessary changes have been done in MyViewClass, for handling EOL mode, but still the error persists.

Why the EOL <<LF>> is interpreted in Notepad illegibly, but not in Wordpad or any other document. What can be done to circumvent the same.
Please let me know.
Posted

1 solution

Notepad uses a standard Windows Edit Box. This requires a CR/LF combination for a new line. Wordpad uses a customised RichEdit control.

Basically, you are going to have to insert a '\r' everywhere there a '\n' in the string before you send it across. There are a heap of ways for doing this. Perhaps CString::Replace("\n", "\r\n"); might be the easiest since you are using MFC.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900