Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CWnd::GetDlgItemInt
CWnd                                        Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  UINT GetDlgItemInt( int nID, BOOL* lpTrans = NULL,
                      BOOL bSigned = TRUE ) const;
 
  Parameter   Description
 
  <nID>       Specifies the integer identifier of the dialog-box item to
              be translated.
 
  <lpTrans>   Points to the Boolean variable that is to receive the
              translated flag.
 
  <bSigned>   Specifies whether the value to be retrieved is signed.
 
  Remarks
 
  Translates the text of the specified control in the given dialog box
  into an integer value.
 
  Retrieves the text of the control identified by <nID>. It translates the
  text by stripping any extra spaces at the beginning of the text and
  converting decimal digits, stopping the translation when it reaches the
  end of the text or encounters any nonnumeric character.
 
  If <bSigned> is TRUE, GetDlgItemInt checks for a minus sign (-) at the
  beginning of the text and translates the text into a signed number.
  Otherwise, it creates an unsigned value.
 
  Sends a WM_GETTEXT message to the control.
 
  Return Value
 
  Specifies the translated value of the dialog-box item text. Since 0 is a
  valid return value, <lpTrans> must be used to detect errors. If a signed
  return value is desired, cast it as an int type.
 
  Zero if the translated number is greater than 32,767 (for signed
  numbers) or 65,535 (for unsigned).
 
  When errors occur, such as encountering nonnumeric characters and
  exceeding the given maximum, GetDlgItemInt copies 0 to the location
  pointed to by <lpTrans>. If there are no errors, <lpTrans> receives a
  nonzero value. If <lpTrans> is NULL, GetDlgItemInt does not warn about
  errors.
 
  See Also
 
  CWnd::GetDlgItemText, ::GetDlgItemInt
 
 
                                     -♦-