I'm trying to get a string with this function:
GetDlgItemText(hWnd, IDC_SECTIONTYPE, buffer, sizeof(buffer) / sizeof(TCHAR));
sectionType = _tcstod(buffer, &pEnd);
But it doesn't work!
Is there other function for this?
I'm trying to get a string with this function:
GetDlgItemText(hWnd, IDC_SECTIONTYPE, buffer, sizeof(buffer) / sizeof(TCHAR));
sectionType = _tcstod(buffer, &pEnd);
But it doesn't work!
Is there other function for this?
I think the size you are sending is wrong.
If you have declared
buffer[64]="\0";
then
GetDlgItemText(hWnd,IDC_EDITCONTL,Buffer,64);
GetDlgItemText is asking for the MAX storage space it can use, not how much of the buffer is used before you send it in.
It compile but does not output, I'm using this:
wsprintf( string, "%s", SectionType );
SetDlgItemText(hWnd,IDC_OUTPUT,string);
Is this wrong?
Could be the
wsprintf
Try sprintf instead (same format, just remove the w from wsprintf).
Check that you have the text in the string, use a messagebox or debugger to watch.
ie
MessageBox(NULL,string,"Debug",MB_OK);
(If you have the HWND use that instead of the NULL)
Look at the return from SetDlgItemText and use GetLastError() if failing.