Visual C++ and MFC Fundamentals Chapter 2: Introduction to MFC
Here is an example:
void CExerciseDlg::OnMsgBox()
{
// TODO: Add your control notification handler code here
int Answer;
Answer = MessageBox("Due to an unknown internal error, "
"this application will now close.\n"
"Do you want to save the file before closing?",
"Regular Warning",
MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2);
if( Answer == IDNO )
return;
}