Freigeben über


VCCLCompilerTool.CompileAs-Eigenschaft

Wählt die Kompilierungssprachoption für C- und CPP-Dateien aus. CompileAs macht die Funktionalität der Compileroptionen /Tc, /Tp, /TC, /TP (Typ der Quelldatei angeben) verfügbar.

Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Syntax

'Declaration
Property CompileAs As CompileAsOptions
CompileAsOptions CompileAs { get; set; }
property CompileAsOptions CompileAs {
    CompileAsOptions get ();
    void set (CompileAsOptions value);
}
abstract CompileAs : CompileAsOptions with get, set
function get CompileAs () : CompileAsOptions 
function set CompileAs (value : CompileAsOptions)

Eigenschaftswert

Typ: Microsoft.VisualStudio.VCProjectEngine.CompileAsOptions
Eine CompileAsOptions-Enumeration.

Beispiele

Siehe Gewusst wie: Kompilieren von Beispielcode für die Erweiterbarkeit von Projektmodellen zu Informationen darüber, wie dieses Beispiel kompiliert und ausgeführt wird.

Im folgenden Beispiel wird die Eigenschaft CompileAs in der integrierten Entwicklungsumgebung (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
        prj = DTE.Solution.Projects.Item(1).Object
        cfgs = prj.Configurations
        cfg = cfgs.Item(1)
        tool = cfg.Tools("VCCLCompilerTool")
        tool.CompileAs = CompileAsOptions.compileAsC
    End Sub
End Module

.NET Framework-Sicherheit

Siehe auch

Referenz

VCCLCompilerTool Schnittstelle

Microsoft.VisualStudio.VCProjectEngine-Namespace