다음을 통해 공유


COleControlContainer::GetDlgItemInt

Retrieves the value of the translated text of the given control.

virtual UINT GetDlgItemInt(
   int nID,
   BOOL* lpTrans,
   BOOL bSigned 
) const;

Parameters

  • nID
    The identifier of the control.

  • lpTrans
    Pointer to a Boolean variable that receives a function success/failure value (TRUE indicates success, FALSE indicates failure).

  • bSigned
    Specifies whether the function should examine the text for a minus sign at the beginning and return a signed integer value if it finds one. If the bSigned parameter is TRUE, specifying that the value to be retrieved is a signed integer value, cast the return value to an int type. To get extended error information, call GetLastError.

Return Value

If successful, the variable pointed to by lpTrans is set to TRUE, and the return value is the translated value of the control text.

If the function fails, the variable pointed to by lpTrans is set to FALSE, and the return value is zero. Note that, since zero is a possible translated value, a return value of zero does not by itself indicate failure.

If lpTrans is NULL, the function returns no information about success or failure.

Remarks

The function translates the retrieved text by stripping any extra spaces at the beginning of the text and then converting the decimal digits. The function stops translating when it reaches the end of the text or encounters a nonnumeric character.

This function returns zero if the translated value is greater than INT_MAX (for signed numbers) or UINT_MAX (for unsigned numbers).

Requirements

Header: afxocc.h

See Also

Concepts

COleControlContainer Class

COleControlContainer Members

Hierarchy Chart