I'm trying to create a dialog-base mfc application that require user to input data in edit box, then the application take it. However, it only work when I convert the data into Integer data and do not work when I try to convert to float data. Can anyone help me please ?
Here is my code
-
#include "cstdlib"
-
#include "tchar.h"
-
void CProjectDlg::OnBnClickedOk()
-
{
-
CString c_str;
-
GetDlgItemTextW(IDC_EDIT1,c_str);
-
int m_int=_tstoi(s1);
-
GetDlgItemTextW(IDC_EDIT2,c_str);
-
float m_float=_ttof(s1);/* error here, it say identifier not found */
-
}
-
Please note that my edit box accept any kind of data, so I prefer accept input as string and convert it into different data type depend on situation