Condividi tramite


Proprietà VCCLCompilerTool.CompileAs

Seleziona il linguaggio di compilazione per i file .c e .cpp. L'oggetto CompileAs espone la funzionalità delle opzioni /Tc, /Tp, /TC, /TP (Specifica il tipo di file di origine) del compilatore.

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

Sintassi

'Dichiarazione
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)

Valore proprietà

Tipo: Microsoft.VisualStudio.VCProjectEngine.CompileAsOptions
Enumerazione CompileAsOptions.

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 riportato di seguito la proprietà CompileAs nell'ambiente di sviluppo 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
        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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

VCCLCompilerTool Interfaccia

Spazio dei nomi Microsoft.VisualStudio.VCProjectEngine