CDialog::OnInitDialog();at the start of your class's OnInitDialog() method. It should look like this:
BOOL CMyDlg::OnInitDialog() { CDialog::OnInitDialog(); // ... Do your stuff ... return TRUE; }Declared in the .h file as:
virtual BOOL OnInitDialog();