AddFileSettings Method

Home Page (Objects)OverviewFAQReference

Applies to: Configuration object

Changes the settings of a specified file.

Syntax

object.AddFileSettings file, settings

Parameters

object

An expression that evaluates to a Configuration object.

file

A String that contains the name of the file whose settings you want to change.

settings

A String that includes the settings or command-line flags you want to add to your project. You can add multiple flags by separating them with spaces. For instance, you can specify "/D_NEW_SYMBOL /J" to add the flags "/D_NEW_SYMBOL" and "/J" to the makefile. If you try to add flags that already exist, Developer Studio will disregard them.

Example

The following example adds a compiler switch to the first configuration of the first project in your workspace:

Sub AddPreprocMacroDefine
If Projects(1).Type = "Build" Then
   Projects(1).Configurations(1).AddFileSettings "myfile.cpp", "/D_DEFINEME"
End If
End Sub

See Also   RemoveFileSettings method.