How should I change this vs2010 code to work in vs2013?
This is part of MFC application. I have two Edit Control with CString variables m_Name, and m_Age. There is also a print button that if clicked it shows these two information on a Message Box.
void CMyProgramDlg::OnBUTTON_PRINT()
{
UpdateData(TRUE);
char szText[100];
sprintf(szText, "Name: %s\n"\
"Age: %d",
m_Name, m_Age);
MessageBox(szText, m_Name+"Message", NULL);
}
The problem is MessageBox() doesn't take char any more. So I converted to CString. But the new problem is the printed message only shows the first letter of the name and age. So if I put in 'Jack' for the name and '40' for the age, it only shows 'J' and '4'.