How to get the text string in the edit box?
-
:confused: Maybe this question sounds a little stupid. But I really had some trouble getting the text string I typed in the edit box. It is just 1 line string. I used this function: iLength = SendMessage(hwndEditBox, EM_GETLINE, 0, (LPARAM) szBuffer); I supposed that it should be working. But I used the debugger to check the string. There is nothing in szBuffer. I used this function iCount = SendMessage(hwndEditBox, EM_LINELENGTH, 0, 0); the return value is right. So, how can I get the text string out of the edit box? Thanks! I am waiting online.
-
:confused: Maybe this question sounds a little stupid. But I really had some trouble getting the text string I typed in the edit box. It is just 1 line string. I used this function: iLength = SendMessage(hwndEditBox, EM_GETLINE, 0, (LPARAM) szBuffer); I supposed that it should be working. But I used the debugger to check the string. There is nothing in szBuffer. I used this function iCount = SendMessage(hwndEditBox, EM_LINELENGTH, 0, 0); the return value is right. So, how can I get the text string out of the edit box? Thanks! I am waiting online.
U ve got two options.Either u can associate ur edit box with a CString (via classwizard when u create ur ressource for example).Normally u type ur string and when u close the dialog box ur sring is stored in ur CString.OR the other solution is 2 associate ur edit box with a Cedit object and to use the member function "GetWindowText()".I don t know if what I m saying is of any help 4 u, but good luck anyway sysy