Home > Software engineering >  MFC GETLINE compiler error, a great god help to see see!!!!!!
MFC GETLINE compiler error, a great god help to see see!!!!!!

Time:10-02

Procedure is as follows:
Char str1 [256].
CEdit * m_Edit1=(CEdit *) GetDlgItem (IDC_EDIT_Rev);//edit box control with ID IDC_EDIT_Rev
Memset (str1, 0256);
M_Edit1 - & gt; GetLine (count, str1, sizeof (str1));
Compile errors: parameters can not be 2 from "char [256]" into "LPTSTR," has nothing to do with the point to the type of; Transformation requires the reinterpret_cast, C style style transformation conversion or function

CodePudding user response:

Instead of char TCHAR, can adapt to UNICODE and multi-byte compile environment

 
TCHAR str1 [256].
Memset (str1, 0, sizeof (str1));
CEdit * m_Edit1=(CEdit *) GetDlgItem (IDC_EDIT_Rev);//edit box control with ID IDC_EDIT_Rev
If (m_Edit1)
M_Edit1 - & gt; GetLine (count, str1, _countof (str1));

CodePudding user response:

Type does not try to casts
  • Related