Condividi tramite


Proprietà VCCLCompilerTool.PreprocessorDefinitions

Ottiene o imposta una o più definizioni per il preprocessore.PreprocessorDefinitions espone la funzionalità del compilatore /D (definizioni preprocessore) opzione, il compilatore MIDL Pagine delle proprietà MIDL: Generale opzione e il compilatore di risorse Pagine delle proprietà Risorse opzione.

Spazio dei nomi:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Sintassi

'Dichiarazione
Property PreprocessorDefinitions As String
string PreprocessorDefinitions { get; set; }
property String^ PreprocessorDefinitions {
    String^ get ();
    void set (String^ value);
}
abstract PreprocessorDefinitions : string with get, set
function get PreprocessorDefinitions () : String
function set PreprocessorDefinitions (value : String)

Valore proprietà

Tipo: System.String
Una o più definizioni per il preprocessore.

Esempi

vedere Procedura: compilare codice di esempio per l'Extensibility del modello di progetto per informazioni su come compilare ed eseguire l'esempio.

Nell'esempio seguente viene modificato il compilatore PreprocessorDefinitions proprietà nell'ambiente di sviluppo (IDE) integrato (IDE):

' add reference to Microsoft.VisualStudio.VCProjectEngine.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim prj As VCProject
        Dim cfgs, tools As IVCCollection
        Dim cfg As VCConfiguration
        Dim tool As VCCLCompilerTool
        Dim oldDefs As String
        prj = DTE.Solution.Projects.Item(1).Object
        cfgs = prj.Configurations
        cfg = cfgs.Item(1)
        tool = cfg.Tools("VCCLCompilerTool")
        oldDefs = tool.PreprocessorDefinitions
        tool.PreprocessorDefinitions = "_TEST;" + oldDefs
        MsgBox(tool.PreprocessorDefinitions)
    End Sub
End Module

Sicurezza di .NET Framework

Vedere anche

Riferimenti

VCCLCompilerTool Interfaccia

Spazio dei nomi Microsoft.VisualStudio.VCProjectEngine