"size" and "at" is a member function of basic_string.
1) include basic_string header file
#include <string>
using namespace std;
Replace CString m_sFrom; with string m_sFrom;
2) If you still want to use CString than
BOOL CEMailDlg::Validate()
{
CString m_sFrom;
for(int a = 0; a < m_sFrom.GetLength(); a++)
{
if(m_sFrom.GetAt(a) == '@')
return true;
} return false;
}