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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With