When I created my visual studio project it defaulted to forcing me to use wide strings for all the functions which take character strings. MessageBox() for example, takes a LPCWSTR rather than a const char*. While I understand that it’s great for multi-lingual and portable applications, it is completely unnecessary for my simple little app. Quite frankly, it’s more of a pain to constantly type TEXT() around all my strings.
Is there a compiler option, define or project setting which I can alter to fix this in my Visual Studio project?
Right click on your project -> Properties then go to the following tree item:
For Unicode select:
Use Unicode Character Strings
For normal multi-byte select:
Use Multi-Byte Character Set
When you put
TEXT()or_T()around your strings, you are making it compatible with both of the character string options. If you selectUse multi-byte character setthen you do not need anything around your strings. If you selectUse unicode character set, you need at least L in front of your strings.By selecting
Use Unicode Character Stringsyou are also by default using all of the Win32 API that end in W. Example:MessageBoxmaps toMessageBoxW.When you select
Use multi-byte character setyou are also by default using all of the Win32 API that end in A. Example:MessageBoxmaps toMessageBoxA.