virtual void OnOK(); // declaration in header file
void MyDialog::OnOK()
{
m_truckSpeed = GetDlgItemInt(IDC_EDIT_TRUCK);
m_carSpeed = GetDlgItemInt(IDC_EDIT_CAR);
CDialog::OnOK(); /* Now I call the real OnOK so I can gain its functionality as well */
}