Partager via


VCCLCompilerTool.WarningLevel, propriété

Obtient ou définit une valeur qui représente la rigueur avec laquelle le compilateur vérifie les constructions potentiellement suspectes. WarningLevel expose les fonctionnalités de l'option /w, /Wn, /WX, /Wall, /wln, /wdn, /wen, /won (Niveau d'avertissement) du compilateur C++ et l'option /w, /Wn, /WX, /Wall, /wln, /wdn, /wen, /won (Niveau d'avertissement) du compilateur MIDL.

Espace de noms :  Microsoft.VisualStudio.VCProjectEngine
Assembly :  Microsoft.VisualStudio.VCProjectEngine (dans Microsoft.VisualStudio.VCProjectEngine.dll)

Syntaxe

'Déclaration
Property WarningLevel As warningLevelOption
warningLevelOption WarningLevel { get; set; }
property warningLevelOption WarningLevel {
    warningLevelOption get ();
    void set (warningLevelOption value);
}
abstract WarningLevel : warningLevelOption with get, set
function get WarningLevel () : warningLevelOption 
function set WarningLevel (value : warningLevelOption)

Valeur de propriété

Type : Microsoft.VisualStudio.VCProjectEngine.warningLevelOption
Valeur d'énumération warningLevelOption.

Notes

Utilisez l'énumération d'warningLevelOption pour modifier la valeur de propriété d'WarningLevel.

Exemples

Consultez Comment : compiler l'exemple de code pour l'extensibilité du modèle de projet pour plus d'informations sur la compilation et l'exécution de cet exemple.

L'exemple suivant modifie la propriété d'WarningLevel du compilateur dans l'environnement de développement intégré (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.WarningLevel = warningLevelOption.warningLevel_0
    End Sub
End Module

Sécurité .NET Framework

Voir aussi

Référence

VCCLCompilerTool Interface

Microsoft.VisualStudio.VCProjectEngine, espace de noms