VCMidlTool.PreprocessorDefinitions Özellik

Tanım

Bir veya daha fazla önişlemci tarafından tanımlanır veya ayarlar.

public:
 property System::String ^ PreprocessorDefinitions { System::String ^ get(); void set(System::String ^ value); };
public:
 property Platform::String ^ PreprocessorDefinitions { Platform::String ^ get(); void set(Platform::String ^ value); };
[System.Runtime.InteropServices.DispId(2)]
public string PreprocessorDefinitions { [System.Runtime.InteropServices.DispId(2)] get; [System.Runtime.InteropServices.DispId(2)] set; }
[<System.Runtime.InteropServices.DispId(2)>]
[<get: System.Runtime.InteropServices.DispId(2)>]
[<set: System.Runtime.InteropServices.DispId(2)>]
member this.PreprocessorDefinitions : string with get, set
Public Property PreprocessorDefinitions As String

Özellik Değeri

String

Bir veya daha fazla önişlemci tanımlıyor.

Öznitelikler

Örnekler

Bu örneği derlemek ve çalıştırmak hakkında bilgi için bkz. nasıl yapılır: proje modeli genişletilebilirliği Için örnek kod derleme .

Aşağıdaki örnek, derleyicinin PreprocessorDefinitions özelliğini tümleşik geliştirme ortamında (IDE) değiştirir:

[Visual Basic]

' 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  

Açıklamalar

PreprocessorDefinitions Derleyicinin /d (Önişlemci tanımları) seçeneğinin, MIDL derleyicisinin MIDL özellik sayfaları: genel seçeneğini ve Kaynak derleyicinin kaynaklar özellik sayfaları seçeneğini sunar.

Şunlara uygulanır