1 error c2440: "=": cannot be converted from "const char [14]" to "lpcwstr"
1> it has nothing to do with the type to be pointed to; conversion requires reinterpret_cast, C style conversion or function style Conversion
1> parameter 2 cannot be converted from "const char [14]" to "lpcwstr"
1> it has nothing to do with the type to be pointed to; conversion requires reinterpret_cast, C style conversion or function style Conversion
1> parameter 2 cannot be converted from "char [20]" to "lpcwstr"
1> it has nothing to do with the type to be pointed to; conversion requires reinterpret_cast, C style conversion or function style Conversion
If you assign a value to a cstring directly, such as cstring STR = "char", or directly enter "char" in the function parameter, or assign a value to a string, the preceding error occurs. You can solve this problem using either of the following methods:
1. Add text before the content (invalid variable), such as MessageBox (hwnd, szchar, text ("char"), 0 );------
UNICODE: converts all strings to text ("") or _ T ("")
For example,
ABC. lpszclassname = "fb2009"; should be changed
ABC. lpszclassname = _ T ("fb2009 ");
To do this, you also need to include the tchar. h header file.
2. In Project Properties> General, change the uicode to multi-character segments.
Configuration properties-> C/C ++-> pre-processor Definition
Check whether Unicode/_ Unicode exists. If yes, remove it and check again.ProgramIs there define?