CString n1,n2;
GetDlgItemText(num1,n1);
GetDlgItemText(num2,n2);
int a,b;
a=atoi((char*)(LPCTSTR)n1);
b=atoi((char*)(LPCTSTR)n2);
但是只有第一个数字,比如n1=“12345” 而a=1
------解决方案--------------------------------------------------------
CString m_str;
int num;
num = _ttoi(m_str);