error C2664: 'MessageBox' : cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR'

Получаю вот такую ошибку при передаче в WinAPI'шные функции чистого char'а в Visual C++.

Избавиться от нее можно применяя макрос TEXT () (или _T ()) к своим строкам:
MessageBox(0,TEXT("Error: NOT_ERROR"),_T("Error"),0);

Поблагодарить автора

One Response to error C2664: 'MessageBox' : cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR'

Оставить комментарий

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>