CWnd::GetWindowText
int GetWindowText( LPTSTR lpszStringBuf, intnMaxCount) const;
void GetWindowText( CString& rString ) const;
#include <shlwapi.h>//包含头文件
void CTestDlg::OnBnClickedBtnAdd()
{
// TODO: Add your control notification handler code here
int num1,num2,num3;
CString ch1, ch2;
CString ch3;
GetDlgItem(IDC_EDIT1)->GetWindowText(ch1);
GetDlgItem(IDC_EDIT2)->GetWindowText(ch2);
num1=StrToInt(ch1);
num2=StrToInt(ch2);
num3 = num1 + num2;
ch3.Format(L"%d",num3);
GetDlgItem(IDC_EDIT3)->SetWindowText(ch3);
}