Character Set problems. The Unicode character is larger than the ANSI memory usage. In the Win32 program, the standard definition char occupies one byte, and the Unicode version of char is defined as follows: typedef unsigned short wchar_t; occupies two bytes. Therefore, the function with characters as parameters also uses two versions.
Solution 1:
All functions with character parameters in the Wide-byte version should use the wide-byte version of the character parameter, it is easy to convert the string into a wide-byte: for example, to convert "application error" to the Unicode version, you only need to use a defined macro before it, such as l "application error" or text ("application error"). Therefore, you should set MessageBox (null, temp, "application error", mb_iconstop); changed to: MessageBox (null, temp, l "application error", mb_iconstop );
Solution 2:
Set vs project --> properties --> Configuration properties --> General --> character set --> using multi-Byte Character Set