I'm using Visual Studio 2010 SP1. I notice that I can add property sheets to a project but I cannot change the character set in those property sheets. Any property sheet I create is missing the 'Character Set' option.
Can anyone explain why I can't set the character set using a property sheet? Is there some list of forbidden properties that can't be set using a property sheet?
Thanks
Ok I did some searching on my hard drive and found the answer.
Project Defaults, which Character Set is a part of, define which default MSBuild property sheets to inherit. Therefore when you choose Character Set in your project you are not changing preprocessor defines in your project file, and instead your project file will inherit a character set property sheet which changes those defines. If you do not choose a character set then no property sheet is inherited.
The Unicode and MBCS property sheets are located here:
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.MultiByteCharSupport.props
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.unicodesupport.props
The MBCS property sheet only adds _MBCS to the compiler's preprocessor defines (C/C++ Preprocessor Definitions). The Unicode property sheet only adds UNICODE and _UNICODE to both the compiler's preprocessor defines (C/C++ Preprocessor Definitions) and the resource compiler's defines (Resources Preprocessor Definitions). And that's it.
来源:https://stackoverflow.com/questions/12343438/visual-studio-property-sheets-why-is-character-set-missing