Retrieves the value of a numeric input field or a mask variable.
C
BOOL SftMask_Contents_GetValue(HWND hwndCtl, short index, LPVARIANT lpVar);
C++
BOOL CSftMask::GetValue(short index, LPVARIANT lpVar) const;
hwndCtl
The window handle of the masked edit control.
index
The variable number (0 through 9) defined using the !number value token (see Edit Masks). Numeric input fields are not numbered automatically; enclose a field in !number...!! to retrieve it.
lpVar
The address of a VARIANT receiving the value.
TRUE if index is between 0 and 9, otherwise FALSE. A variable that is not defined in the mask returns TRUE with VT_EMPTY.
If the variable encloses exactly one numeric input field ($ or $I, with or without fractional digits), the value is returned as VT_R8 (dblVal; negative for a negative entry), or VT_EMPTY if the field contains no digits. Otherwise the value is returned as VT_BSTR holding the entered characters without literals and group separators; unfilled positions appear as carriage-return (\r) characters. lpVar must point to an initialized VARIANT (VariantInit); release the result with VariantClear. Using value tokens, portions of the input data can be accessed without knowing the exact character positions.
See Also SetValue | GetDateTime | Edit Masks