{
// TODO: Add your control notification handler code here
UpdateData();
isresult=TRUE;
num1 = m_edit;
m_edit="";
UpdateData(false);
oper=1;
}
void CCalDlg::OnButtondeng()
{
// TODO: Add your control notification handler code here
UpdateData();
num2 = m_edit;
double result=0;
double firnum=atof(num1);
double secnum=atof(num2);
switch(oper)
{case 1:result=firnum+secnum;
m_edit.Format("%g",result);
UpdateData(false);
break;}
}
在使用m_edit前,要先updatedata更新控件內容到變量。