Chapter 18: Progress-Based Controls Visual C++ and MFC Fundamentals
MessageBeep(MB_ICONEXCLAMATION);
}
if( nIDEvent == IDT_HEART )
m_Heart.put_Value(Heart);
if( nIDEvent == IDT_KIDNEY )
m_Kidney.put_Value(Kidney);
if( nIDEvent == IDT_BRAIN )
m_Brain.put_Value(Brain);
if( nIDEvent == IDT_LLUNG )
m_LLung.put_Value(LeftLung);
if( nIDEvent == IDT_RLUNG )
m_RLung.put_Value(RightLung);
if( nIDEvent == IDT_PANCREAS )
m_Pancreas.put_Value(Pancreas);
if( nIDEvent == IDT_LIVER )
m_Liver.put_Value(Liver);
if( nIDEvent == IDT_BLADDER )
m_Bladder.put_Value(Bladder);
if( nIDEvent == IDT_STOMACH )
m_Stomach.put_Value(Stomach);
m_ValBlood.Format("%.f.%d", m_Blood.get_Value(), rand()%99);
m_ValHeart.Format("%.f\260", m_Heart.get_Value());
m_ValKidney.Format("%.f\045", m_Kidney.get_Value());
m_ValBrain.Format("<%.f", m_Brain.get_Value());
m_ValLLung.Format("%.f'%d\"", m_LLung.get_Value(), 2+rand()%9);
m_ValRLung.Format("%.f\261", m_RLung.get_Value());
m_ValPancreas.Format("\273%.f", m_Pancreas.get_Value());
m_ValLiver.Format("%.f\260", m_Liver.get_Value());
m_ValBladder.Format("\247%.f\252", m_Bladder.get_Value());
CString SCode;
switch(rand()%3)
{
case 0:
SCode.Format("%s", "\274");
break;
case 1:
SCode.Format("%s", "\275");
break;
case 2:
SCode.Format("%s", "\276");
break;
}
m_ValStomach.Format("%.f%s", m_Stomach.get_Value(), SCode);
UpdateData(FALSE);
CDialog::OnTimer(nIDEvent);
}
- Test the application