VS2008 tip error C2664: "Cwnd::messageboxw": Cannot convert parameter 1 from "const char [17]" to "LPCTSTR"
In the outside to write MFC program with VS2005 often to the MessageBox ("hint message") function, in the vc6.0 is no problem, but in VS2005 will have the following hint:
Error C2664: "Cwnd::messageboxw": Cannot convert parameter 1 from "const char [17]" to "LPCTSTR"
The reason for this error is that VS2005 uses the Unicode character set by default, and errors occur when the parameter is converted
The workaround is simple.
Method One:
MessageBox (_t("You have submitted success. "));
That is, add _t before the parameter
Method Two:
When you create a new project, the use of the Unicode character set is canceled, such as:
Method Three:
Select "Project"-"XXX Project Properties"-"Configuration Properties"-"general" option, change "character set" to "use multibyte Character set" and then OK. Such as:
Error C2664: "MessageBoxW": Cannot convert parameter 2 from "const char [14]" to "LPCWSTR"