共用方式為


DDX_DateTimeCtrl

The DDX_DateTimeCtrl function manages the transfer of date and/or time data between a date and time picker control (CDateTimeCtrl) in a dialog box or form view object and either a CTime or a COleDateTime data member of the dialog box or form view object.

void AFXAPI DDX_DateTimeCtrl(
   CDataExchange* pDX,
   int nIDC,
   CTime& value 
);
void AFXAPI DDX_DateTimeCtrl(
   CDataExchange* pDX,
   int nIDC,
   COleDateTime& value 
);
void AFXAPI DDX_DateTimeCtrl(
   CDataExchange* pDX,
   int nIDC,
   CString& value 
);

Parameters

  • 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.

  • nIDC
    The resource ID of the date and time picker control associated with the member variable.

  • value
    In the first two versions, a reference to a CTime or COleDateTime member variable, dialog box, form view, or control view object with which data is exchanged. In the third version, a reference to a CString data member control view object.

Remarks

When DDX_DateTimeCtrl is called, value is set to the current state of the date and time picker control, or the control is set to value, depending on the direction of the exchange.

In the third version above, DDX_DateTimeCtrl manages the transfer of CString data between a date time control and a CString data member of the control view object. The string is formatted using the current locale's rules for formatting dates and times.

For more information about DDX, see Dialog Data Exchange and Validation.

Requirements

Header: afxoledb.h

See Also

Reference

CDateTimeCtrl Class

CDateTimeCtrl::SetRange

CDateTimeCtrl::GetRange

DDV_MinMaxDateTime

Concepts

MFC Macros and Globals

Other Resources

Standard Dialog Data Exchange Routines