Export (0) Print
Expand All
Expand Minimize
0 out of 1 rated this helpful - Rate this topic

CWnd::GetDlgItemText

Call this member function to retrieve the title or text associated with a control in a dialog box.

int GetDlgItemText(
   int nID,
   LPTSTR lpStr,
   int nMaxCount 
) const;
int GetDlgItemText(
   int nID,
   CString& rString 
) const;

Parameters

nID
Specifies the integer identifier of the control whose title is to be retrieved.
lpStr
Points to the buffer to receive the control's title or text.
nMaxCount
Specifies the maximum length (in bytes) of the string to be copied to lpStr. If the string is longer than nMaxCount, it is truncated.
rString
A reference to a CString.

Return Value

Specifies the actual number of bytes copied to the buffer, not including the terminating null character. The value is 0 if no text is copied.

Remarks

The GetDlgItemText member function copies the text to the location pointed to by lpStr and returns a count of the number of bytes it copies.

See Also

CWnd Overview | Class Members | Hierarchy Chart | CWnd::GetDlgItem | CWnd::GetDlgItemInt | GetDlgItemText | WM_GETTEXT

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.