My request is small
I am using GetDlgItem() to get text from a text field , but I have a problem in the fourth parameter (i.e. size of buffer) .
LPWSTR txtbuff;
GetDlgItemText(hwnd, IDC_EDIT1, txtbuff, 50); // the fourth parameter (50)
MessageBox(NULL,txtbuff,L"Error message",MB_OK)
How can I compute size of txtbuff
You can use GetDlgItem to get the control’s HWND and GetWindowTextLength to determine how many characters are held by your control.