description | title | ms.date | helpviewer_keywords | ms.assetid | |
---|---|---|---|---|---|
Learn more about: Standard Dialog Data Validation Routines |
Standard Dialog Data Validation Routines |
11/04/2016 |
|
44dbc222-a897-4949-925e-7660e8964ccd |
This topic lists the standard dialog data validation (DDV) routines used for common MFC dialog controls.
Note
The standard dialog data exchange routines are defined in the header file afxdd_.h. However, applications should include afxwin.h.
Name | Description |
---|---|
DDV_MaxChars | Verifies the number of characters in a given control value does not exceed a given maximum. |
DDV_MinMaxByte | Verifies a given control value does not exceed a given BYTE range. |
DDV_MinMaxDateTime | Verifies a given control value does not exceed a given time range. |
DDV_MinMaxDouble | Verifies a given control value does not exceed a given double range. |
DDV_MinMaxDWord | Verifies a given control value does not exceed a given DWORD range. |
DDV_MinMaxFloat | Verifies a given control value does not exceed a given float range. |
DDV_MinMaxInt | Verifies a given control value does not exceed a given int range. |
DDV_MinMaxLong | Verifies a given control value does not exceed a given long range. |
DDV_MinMaxLongLong | Verifies a given control value does not exceed a given LONGLONG range. |
DDV_MinMaxMonth | Verifies a given control value does not exceed a given date range. |
DDV_MinMaxShort | Verifies a given control value does not exceed a given short range. |
DDV_MinMaxSlider | Verifies a given slider control value falls within the given range. |
DDV_MinMaxUInt | Verifies a given control value does not exceed a given UINT range. |
DDV_MinMaxUnsigned | Verifies a given control value falls between two specified values. |
DDV_MinMaxULongLong | Verifies a given control value does not exceed a given ULONGLONG range. |
Call DDV_MaxChars
to verify that the amount of characters in the control associated with value does not exceed nChars.
void AFXAPI DDV_MaxChars(
CDataExchange* pDX,
CString const& value,
int nChars);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
nChars
Maximum number of characters allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxByte
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxByte(
CDataExchange* pDX,
BYTE value,
BYTE minVal,
BYTE maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type BYTE) allowed.
maxVal
Maximum value (of type BYTE) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxDateTime
to verify that the time/date value in the date and time picker control ( CDateTimeCtrl) associated with refValue falls between refMinRange and refMaxRange.
void AFXAPI DDV_MinMaxDateTime(
CDataExchange* pDX,
CTime& refValue,
const CTime* refMinRange,
const CTime* refMaxRange);
void AFXAPI DDV_MinMaxDateTime(
CDataExchange* pDX,
COleDateTime& refValue,
const COleDateTime* refMinRange,
const COleDateTime* refMaxRange);
pDX
A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction. You don't need to delete this object.
refValue
A reference to a CTime or COleDateTime object associated with a member variable of the dialog box, form view, or control view object. This object contains the data to be validated.
refMinRange
Minimum date/time value allowed.
refMaxRange
Maximum date/time value allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxDouble
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxDouble(
CDataExchange* pDX,
double const& value,
double minVal,
double maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type double
) allowed.
maxVal
Maximum value (of type double
) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxDWord
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxDWord(
CDataExchange* pDX,
DWORD const& value,
DWORD minVal,
DWORD maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type DWORD) allowed.
maxVal
Maximum value (of type DWORD) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxFloat
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxFloat(
CDataExchange* pDX,
float value,
float minVal,
float maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type float
) allowed.
maxVal
Maximum value (of type float
) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxInt
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxInt(
CDataExchange* pDX,
int value,
int minVal,
int maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type int
) allowed.
maxVal
Maximum value (of type int
) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxLong
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxLong(
CDataExchange* pDX,
long value,
long minVal,
long maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type long
) allowed.
maxVal
Maximum value (of type long
) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxLongLong
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxLongLong(
CDataExchange* pDX,
LONGLONG value,
LONGLONG minVal,
LONGLONG maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type LONGLONG) allowed.
maxVal
Maximum value (of type LONGLONG) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxMonth
to verify that the time/date value in the month calendar control ( CMonthCalCtrl) associated with refValue falls between refMinRange and refMaxRange.
void AFXAPI DDV_MinMaxMonth(
CDataExchange* pDX,
CTime& refValue,
const CTime* refMinRange,
const CTime* refMaxRange);
void AFXAPI DDV_MinMaxMonth(
CDataExchange* pDX,
COleDateTime& refValue,
const COleDateTime* refMinRange,
const COleDateTime* refMaxRange);
pDX
A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
refValue
A reference to an object of type CTime
or COleDateTime
associated with a member variable of the dialog box, form view, or control view object. This object contains the data to be validated. MFC passes this reference when DDV_MinMaxMonth
is called.
refMinRange
Minimum date/time value allowed.
refMaxRange
Maximum date/time value allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxShort
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxShort(
CDataExchange* pDX,
short value,
short minVal,
short maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type short
) allowed.
maxVal
Maximum value (of type short
) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxSlider
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxSlider(
CDataExchange* pDX,
DWORD value,
DWORD minVal,
DWORD maxVal);
pDX
A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to the value to be validated. This parameter holds or sets the slider control's current thumb position.
minVal
Minimum value allowed.
maxVal
Maximum value allowed.
For more information about DDV, see Dialog Data Exchange and Validation. For information about slider controls, see Using CSliderCtrl.
Header afxdd_.h
Call DDV_MinMaxUInt
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxUInt(
CDataExchange* pDX,
UINT value,
UINT minVal,
UINT maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type UINT) allowed.
maxVal
Maximum value (of type UINT) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxULongLong
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxULongLong(
CDataExchange* pDX,
ULONGLONG value,
ULONGLONG minVal ,
ULONGLONG maxVal);
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type ULONGLONG) allowed.
maxVal
Maximum value (of type ULONGLONG) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header afxdd_.h
Call DDV_MinMaxUnsigned
to verify that the value in the control associated with value falls between minVal and maxVal.
void AFXAPI DDV_MinMaxUnsigned(
CDataExchange* pDX,
unsigned value,
unsigned minVal,
unsigned maxVal );
pDX
A pointer to a CDataExchange
object. The framework supplies this object to establish the context of the data exchange, including its direction.
value
A reference to a member variable of the dialog box, form view, or control view object with which data is validated.
minVal
Minimum value (of type unsigned
) allowed.
maxVal
Maximum value (of type unsigned
) allowed.
For more information about DDV, see Dialog Data Exchange and Validation.
Header: afxdd_.h
Standard Dialog Data Exchange Routines
Macros and Globals
DDX_Slider
DDX_FieldSlider