|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Property Pages (C++)
A project property page is a Visual Studio user interface element that allows you to specify and apply project settings to your projects.
You access property pages by selecting a project and clicking Properties on the shortcut menu or clicking Properties on the Project menu. When you specify values in the Property Pages dialog box, they are applied to the selected project or projects in Solution Explorer.
You can specify and apply project settings to all build configurations, or you can specify separate project properties for each build configuration. For example, you can specify settings for the Release configuration that do not apply to the Debug configuration.
Property pages are dynamic, and the pages that are displayed depend on the file types in the project. For example, if you do not have an .idl file in your project, then the IDL property page will not be displayed in the Property Pages dialog box.
For more information, see How to: Specify Project Properties with Property Pages.
Default vs. Modified Properties
Some property values appear in bold, which means that the value was changed. The default setting for a property at the project level when the project node is selected in Solution Explorer is commonly the default value of that property for the tool. For example, in a Win32 project on the compiler's Code Generation property page, the property Enable String Pooling is initially set to No (not bold). This means that No agrees with the project's default setting. If you were to use CL.exe at the command line, /GF would not be in effect unless you specified it.
If you or the application wizard change a property, the value appears in bold. For example, on the same Code Generation property page, /RTC1 is in effect for the Full Runtime Checks property. At the command line, /RTC1 is not in effect by default; in this case, the application wizard changed the project's default setting for the property.
A subset of the project defaults is exposed and available for you to modify. For more information, see the Project Defaults section in General Property Page (Project).
When you view a project's Property Pages dialog box and when the project node is selected in Solution Explorer, for each property you will also have the option to select <inherit from project defaults>.
Click Apply to ensure that the Property Pages dialog box is refreshed with your latest choices when you reset a property to the project's default.
When you view a project's Property Pages dialog box and when a file is selected in Solution Explorer, a property value that appears in bold indicates that the value of the property at the file level has been changed. Accordingly, for each property you will also have the option to select <inherit from project>. If many files have properties that were modified, the time to build the project will increase.
The project defaults are system (platform) defaults, for the most part. Some project defaults derive from the style sheets that are applied when you update properties in the Project Defaults section of the general project configuration page (see General Property Page (Project)).
Entering User-Defined Values
Other properties require you to specify values for the property. Some of these properties take one or more values (multi-properties) and other properties take one value (single properties).
It is possible to type directly in the right column of the property page. Separate values with a semicolon. Use only alphabetic and numeric characters for these properties. No error checking is performed on these values.
You also can select <Edit...> from the drop-down list (for single properties) or the browse button (for a selected multi-property). This opens a dialog box where you can enter a value or values for the property. This dialog box's title will be the same as the name of the property you are editing. For multi-properties, enter one value per line, using a carriage return after each value.
Edit boxes for multi-properties will have a check box labeled inherit from project (for a file) or inherit from project defaults (at the project level). This check box is selected by default, meaning that the property can inherit values from the project, if a file is selected, or from the project defaults, if the project is selected in Solution Explorer.
Note that the displayed values for a multi-property in the property page dialog box only reflect the property settings at the current level. For example, if a file is selected in the Solution Explorer and you select the C/C++ Preprocessor Definitions property, the property page will not display any preprocessor definitions at the project level. However, if you open the edit box for the multi-property, you can see all inherited values for the property.
If you use the Visual C++ Project Model, be aware that this behavior is also in effect for the objects on files and projects. That is, when querying for the values on a property at the file level, you will not get the values for that same property at the project level; you'll need to explicitly get the values of the property at the project level. Be aware that some inherited values of a property may come from a style sheet, which is not accessible programmatically for this release.
$(Inherit) and $(NoInherit) Macros
Note that two macros can be used for properties where you specify user-defined values:
Clearing the check box (for example, inherit from project defaults) is the same as specifying $(NoInherit); using the check box is easier. If you specify $(NoInherit), you may very well want to still specify your own values.
Regardless of the setting for the inherit from project (or inherit from project defaults) check box, if you use either of these macros in the edit box, the setting of the check box is ignored.
If you do use $(NoInherit) on a property, be aware if one of the project defaults affects the property. If it does, you can unintentionally override a project default that you specified.