共用方式為


VCCLCompilerTool.UndefineAllPreprocessorDefinitions 屬性

取得或設定值,指出是否要取消所有前置處理器先前的定義值。 UndefineAllPreprocessorDefinitions 會公開編譯器之 /U、/u (取消定義符號) 選項的功能。

命名空間:  Microsoft.VisualStudio.VCProjectEngine
組件:  Microsoft.VisualStudio.VCProjectEngine (在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

語法

'宣告
Property UndefineAllPreprocessorDefinitions As Boolean
bool UndefineAllPreprocessorDefinitions { get; set; }
property bool UndefineAllPreprocessorDefinitions {
    bool get ();
    void set (bool value);
}
abstract UndefineAllPreprocessorDefinitions : bool with get, set
function get UndefineAllPreprocessorDefinitions () : boolean 
function set UndefineAllPreprocessorDefinitions (value : boolean)

屬性值

類型:Boolean
如果將先前定義的前置處理器值取消定義,則為 true,否則為 false。

範例

如需如何編譯及執行範例的詳細資訊,請參閱 如何:編譯專案模型擴充性的範例程式碼

下列範例會修改在整合式開發環境 (IDE) (IDE) 的 UndefineAllPreprocessorDefinitions 屬性:

' 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
        prj = DTE.Solution.Projects.Item(1).Object
        cfgs = prj.Configurations
        cfg = cfgs.Item(1)
        tool = cfg.Tools("VCCLCompilerTool")
        tool.UndefineAllPreprocessorDefinitions = True
    End Sub
End Module

.NET Framework 安全性

請參閱

參考

VCCLCompilerTool 介面

Microsoft.VisualStudio.VCProjectEngine 命名空間