Share via


ClassWizard and Dialog Data Exchange

OverviewHow Do I

ClassWizard lets you create variables that use the framework's automatic dialog data exchange (DDX) capabilities. When you want to set an initial value for or gather data from a dialog box control, use ClassWizard to define a data member in the dialog box class. The framework then transfers the initial value of the variable to the dialog box when it is created and updates the associated member variable when the dialog box is dismissed.

Note   You can also use to transfer data back and forth between controls and member variables while a dialog box is open.

Note   ClassWizard does not support COleDBRecordView, so you cannot use ClassWizard to do the databinding (message maps) in an OLE DB application.

To databind the controls in an OLE DB application, use dialog data exchange (DDX) data calls with COleDBRecordView just as you would with any other MFC class. You will need to add lines to the recordset file such as:

DDX_Text(IDC_EDIT1, m_pSet->m_nFoo) // if it's a LONG

-or-

DDX_Text(IDC_EDIT1, m_pSet->m_szFoo, 50) // If it's a char 50 array

The databinding technique is illustrated in the sample.

What do you want to know more about?