CWnd::GetDlgItemInt

UINTGetDlgItemInt(intnID**,BOOL*lpTrans=NULL,BOOLbSigned=TRUE)const;**

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.

The function returns 0 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 above 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.

Parameters

nID

Specifies the integer identifier of the dialog-box control 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

Retrieves the text of the control identified by nID. It translates the text of the specified control in the given dialog box into an integer value by stripping any extra spaces at the beginning of the text and converting decimal digits. It stops 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.

It sends a message to the control.

CWnd OverviewClass MembersHierarchy Chart

See Also   CWnd::GetDlgItemText,