ダイアログを閉じるとき、終了しますか?判定させる

OnClose()で

if( IDOK == MessageBox("本当に終了しますか?","確認",MB_OKCANCEL) ){
 CDialog::OnClose();
}