The built in Win32 edit control requires \r\n (Windows) for newline characters. It doesn't support the \n (Unix) variant. Also ensure that the control itself has multiline enabled otherwise they will both be ignored. When inserting text into the control that may have Unix newlines you have to convert them to Windows newlines.
One Edit Box Likes \n, Other Requires \r\n
Hello Folks:
Developing on VS 2022 Community, C++.
Two modules I've developed to help debug my apps have multi line text controls where I display whatever text I think might help as I develop the app.
One edit control inserts a line feed when I send it a "\n" and the other ignores the line feed unless it comes in as a "\r\n".
It's kind of annoying that carefully formatted text displayed in one control looses its formatting when displayed in the other. I have code that will replace "\n" with "\r\n" but I'd rather figure out a way to avoid needing such a function.
The dialogs and edit controls were both defined in the Dialog Editor and the edit control properties for both look identical to me.
Neither edit control received a EM_SETENDOFLINE message but I've recently tested that feature to no effect. An EM_GETENDOFLINE message always seems to return 0, regardless of what I set the control's end of line to.
Any idea what I'm missing?
Thanks
Larry