Little Fighter Empire - Forums

Full Version: [C++] Setting the text in a multiline textbox
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here's the deal:
I'm try to set the text of a multiline textbox to something. I know how to do that.
Here's the problem:
The text that's displayed in the textbox is missing all of the \r\n's.
What's going wrong?!?!?!
The line that stuffs up is:
Code:
SetDlgItemTextA(hwnd, ID_MAIN_EDIT, result);
Source Code (Click to View)
If you have a brain, you have probably figured what this program was going to be...
i am not very familiar with c++ (only had c for one year and i hated it => didn't learn anything properly) so i can only google for you.
http://forums.devshed.com/c-programming-...09073.html
they are talking about a problem with the new line..maybe it helps..
After 1 month this is solved.
Changes are in the "case ID_FILE_OPEN:" section.
^ congratz on solving the problem. If you would point out what excactly was the problem and why you had to change certain things to make it work, that would be nice for future reference.
Oh right. Here we are:
So the code was for decrypting LF2 DAT files. The problem was, once decrypted, the file didn't contain the proper "\r\n"s. (That's the newline character in windows.) Rather, it contained "\r"s and "\n"s separately.
By using file streams and its special input/output modes, we are able to "convert" those separate "\r"s and "\n"s into the proper "\r\n"s.
Read more about the converting of "\r"s and "\n"s here.
pretty sure lf2 data files don't even contain the '\r's, just '\n's. i'm lazy to go to debug mode and check, but i don't really like the idea of decrypting, writing to a file, and re-reading from it. if it is that, u could just add '\r's whenever u find a '\n', but that's kinda more effort.
i'm fussy about performance



Azriel~
I didn't like the idea of reading a file, decrypting it, writing it to another file and then re-reading it again either.
But this repeated input and output is the most convenient way.

ESPECIALLY when you have DAT files that actually do have "\r\n"s.
Man you have given just one line of the program and it is difficult to reach out the solution so please share the whole program so that i can suggest you some thing