Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[C++] Setting the text in a multiline textbox
#1
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...

blow_fly98 edited this post 04-24-2010 08:14 AM because:
Oh look, I'm moderating myself.
No seriously. I need help.
Hiding users' signatures and avatars was the best decision ever.
4ye 6anDy (Click to View)
We're watching you... (Click to View)
| Avatar made by Alectric |
Thanks given by:
#2
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..
[sig placeholder until my new sig is finished]
should totally allow people to be all trolley on their birthday :D
Thanks given by:
#3
After 1 month this is solved.
Changes are in the "case ID_FILE_OPEN:" section.
Hiding users' signatures and avatars was the best decision ever.
4ye 6anDy (Click to View)
We're watching you... (Click to View)
| Avatar made by Alectric |
Thanks given by:
#4
^ 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.
[sig placeholder until my new sig is finished]
should totally allow people to be all trolley on their birthday :D
Thanks given by:
#5
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.
Hiding users' signatures and avatars was the best decision ever.
4ye 6anDy (Click to View)
We're watching you... (Click to View)
| Avatar made by Alectric |
Thanks given by:
#6
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~
Thanks given by:
#7
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.
Hiding users' signatures and avatars was the best decision ever.
4ye 6anDy (Click to View)
We're watching you... (Click to View)
| Avatar made by Alectric |
Thanks given by:
#8
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

MH-Razen edited this post 08-07-2010 10:29 AM because:
second time, no gravedigging plz!
Thanks given by:




Users browsing this thread: 1 Guest(s)