Reason: An error occurred while compiling the program due to setting the character set Unicode property when creating an MFC project
Solution 1:
In the VS Solution Manager window, right-click your project “Project”, then select “Properties” (the last item), click “Configuration Properties”, a + sign, expand it, then select the “General” TAB, the penultimate “Character set”, and select “Use multi-byte Character Set”. Problem solving.
Solution 2:
Solution 1:
In the VS Solution Manager window, right-click your project “Project”, then select “Properties” (the last item), click “Configuration Properties”, a + sign, expand it, then select the “General” TAB, the penultimate “Character set”, and select “Use multi-byte Character Set”. Problem solving.
Solution 2:
Use the call CString::AllocSysString();
Such as:
CString str_cap(“haha”);
(const WCHAR *) (str_cap. AllocSysString ()); .
(LPCTSTR) (str_cap AllocSysString ()); Same as above link:
Click on the open link
Read More:
- Solutions to error c2143: syntax error: missing ‘;’ before ‘type’ in C + + program compilation
- Solution to the problem of no C / C + + option in the new project of eclipse
- C language string processing error warning, c4996, sprintf, predicted, c4996, strcpy, c4996, strcat
- Analysis of shadows a parameter exception in C + +
- Solution to the flash of running result of dev C / C + +
- A fatal error C1083 occurred when compiling C + + code under. Net: unable to open the include file: “xuhk”_ Jnihelloworld. H “: solution to no such file or directory error.
- Sending ‘const NSString *__strong‘ to parameter of type ‘NSString *‘ discards qualifiers
- The use of Chinese characters in Qt and the solution to the “error C2001: newline in constant” problem
- Fatal error C1853 error occurs when there are mixed .c files in the VS project
- C / C + + cannot open the source file directory, the header file is not imported, the solution is as follows
- When C language refers to a user-defined type as a parameter, an error segmentation fault is reported
- Solution to the segmentation fault of single chain table in C language
- Solve the problem of error: cannot pass objects of non trivially copyable type ‘STD:: String’ in C / C + +
- The solution for error: jump to label [-fpermissive] encountered in C
- [Solved] Dev-C++ [Error] ‘for‘ loop initial declarations are only allowed in C99 or C11 mode
- To solve the running error of eclipse for C / C + +: launch failed binary not found
- The solution of “failed to load ldlinux. C32” in Linux system
- Solution to dev C + + error [error] LD returned 1 exit status
- MPI cannot be found in C / C + +
- Solution to error [error] LD returned 1 exit status in C language