- Add a edit control to the dialog resource to the (e.g. ID=IDC_HER).
- Add a member variable of the type CHertzEdit to the dialog class (here: m_herEdit).
Add the function DDX_HertzEdit as handler to the method DoDataExchange() of the dialog class:
void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CParameterPage1)
DDX_HertzEdit(pDX, IDC_HER, m_herEdit);
//}}AFX_DATA_MAP
}
- Call the method SubClassDlgItem() inside the method OnInitDialog of the dialog class:
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_herEdit.SubclassDlgItem(IDC_HER, this);
return(TRUE);
}