VCCLCompilerTool.UndefinePreprocessorDefinitions 属性

定义

获取或设置指定一个或多个预处理器未定义的值。 UndefinePreprocessorDefinitions 公开 c + + 编译器的 /u、/u (取消定义符号) 选项和 midl 编译器的 midl 属性页:高级 选项。

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

属性值

String

一个指定取消一个或多个预处理器定义的字符串。

属性

示例

有关如何编译和运行此示例的信息,请参阅 如何:编译项目模型扩展性的示例代码

下面的示例在 UndefinePreprocessorDefinitions 集成开发环境 (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 oldUndefs As String  
        prj = DTE.Solution.Projects.Item(1).Object  
        cfgs = prj.Configurations  
        cfg = cfgs.Item(1)  
        tool = cfg.Tools("VCCLCompilerTool")  
        oldUndefs = tool.UndefinePreprocessorDefinitions  
        tool.UndefinePreprocessorDefinitions = "_DEBUG;" + oldUndefs  
        MsgBox(tool.UndefinePreprocessorDefinitions)  
    End Sub  
End Module  

适用于