void CtestDlg::OnBnClickedButton1()
{
wchar_t a1[12], a2[12], a3[12];
//方法一 GetWindowText
//GetDlgItem(IDC_EDIT_1)->GetWindowText(a1,12);
//GetDlgItem(IDC_EDIT_2)->GetWindowText(a2, 12);
//_itow_s(_wtoi(a1) + _wtoi(a2),a3,10);
//SetDlgItemText(IDC_EDIT_3, a3);
//方法二 GetDlgItemText
//GetDlgItemText(IDC_EDIT_1,a1,12);
//GetDlgItemText(IDC_EDIT_2, a2,12);
//_itow(_wtoi(a1) + _wtoi(a2), a3, 10);
//SetDlgItemText(IDC_EDIT_3, a3);
//方法三 GetDlgItemInt
//int a = GetDlgItemInt(IDC_EDIT_1);
//int b = GetDlgItemInt(IDC_EDIT_2);
//SetDlgItemText(IDC_EDIT_3, _itow(a + b, a3, 10));
//方法四
}
原文地址:https://www.cnblogs.com/zpchcbd/p/12271065.html
时间: 2024-10-16 10:13:23