Calc
1)New->Project->MFC->app.wizard(exe)->Dialogbased->OK
2)Insert->Resource->Dialog
3)Create a new class ex5cdialog
4)Set the member variables and the group function for the first radio button.
5)Define function on compute that is used to calculate values
6)Build & execute project.
CODE:
void ex5cdialog::OnButton1()
{
UpdateData(TRUE);
switch(m_op)
{
case 0:
m_out=m_in1+m_in2;
break;
case 1:
m_out=m_in1-m_in2;
break;
case 2:
m_out=m_in1*m_in2;
break;
case 3:
m_out=m_in1/m_in2;
break;
}
UpdateData(FALSE);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment