I am just a beginner to MFC platform. I am just trying a simple pgm. Getting 2 numbers in 2 edit boxes and displaying the sum in the third edit box when a button is clicked.
This is my code:
void CMineDlg::OnEnChangeNumber1()
{
CString strNum1,strNum2;
m_Number1.GetWindowText(strNum1,10); //m_NUmber1 is variable to 1st edit box.
m_Number2.GetWindowText(strNum2,10); //m_Number2 is variable to 2nd edit box.
}
void CMineDlg::OnBnClickedSum()
{
m_Result=m_Number1+m_Number2;
}
I know I have to convert the strings to integer. But I have no idea how to do it. Pls Help.