I've created a notepad in WIN API, everything is working great, except when I type a bit of information, I cannot get it from the screen...
for example, if I'll write -> "Hello, How are you?", it'll work correctly, but if I'll write "Hello, How are you? I hope you are doing well!" it wont give me the string..
I'm using the function GetWindowText to get the text the user typed....
I've checked for errors using GetLastError, and got 0 on it...
Here is my code :
string data; // The data the user has typed will be stored here
GetWindowText(Edit, LPSTR(data.c_str()), GetWindowTextLength(Edit) + 1); // Getting the data the user typed
SaveDialog(hwnd, data); // Saving the data the user typed into a file
The save it working correctly, but the problem is that when the user typed a bit of information(like said at the top of the topic), the function GetWindowText gives me this (It isnt showing an error, but in the debuger, when I want to see data's value it says this) :
"+ data <Error reading characters of string.> std::basic_string<char,std::char_traits<char>,std::allocator<char> >"
Thanks for you'r help!