-
get input > 1024 chars?
hey, i was wondering how one would go about getting and manipulating a string that was > 1024 chars from the user. i was thinking i could grab the input in sets (from an edit box on a win32 api text editor), do what i want with it, and then save or send it back to the screen. i dont need help getting the input from the edit box, i just need to know how to find out if theres more text to get or if theres a way i can handle all of the text with one bit of code. thanks :)
-
-
-
lol well as of right now i'm not having a problem with it. i have a pointer for the text and then after getting the length, i use malloc to allocate the memory for the amount needed. :) this is the code i'm using
Code:
...
TCHAR *buf;
int len;
HWND hEdit = GetDlgItem(hwnd, IDC_CHILD_EDIT);
len = GetWindowTextLength(hEdit);
buf = (TCHAR *)malloc(len + 1);
...
-
Size of a TCHAR is not always 1 byte.
So it probably would be safer to do this:
Code:
buf = (TCHAR *)malloc( sizeof(TCHAR) * (len + 1) );
-