void CMainFrame::OnBnClickedButton1() { CProgressCtrl* progress = (CProgressCtrl*) m_wndDlgBar.GetDlgItem(IDC_PROGRESS1); progress->StepIt(); }