Condividi tramite


Proprietà VCMidlTool.StructMemberAlignment

Ottiene o imposta limiti a 1, 2, 4, 8 o 16 byte per l'allineamento dei membri struct.

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

Sintassi

'Dichiarazione
Property StructMemberAlignment As midlStructMemberAlignOption
midlStructMemberAlignOption StructMemberAlignment { get; set; }
property midlStructMemberAlignOption StructMemberAlignment {
    midlStructMemberAlignOption get ();
    void set (midlStructMemberAlignOption value);
}
abstract StructMemberAlignment : midlStructMemberAlignOption with get, set
function get StructMemberAlignment () : midlStructMemberAlignOption 
function set StructMemberAlignment (value : midlStructMemberAlignOption)

Valore proprietà

Tipo: Microsoft.VisualStudio.VCProjectEngine.midlStructMemberAlignOption
Enumerazione midlStructMemberAlignOption.

Note

StructMemberAlignment espone la funzionalità dell'opzione di /Zp (Allineamento membri struct) del compilatore C++ e l'opzione Pagine delle proprietà MIDL: Avanzate del compilatore MIDL.

Utilizzare l'enumerazione di structMemberAlignOption per modificare il valore della proprietà di VCCLCompilerTool.

Utilizzare midlStructMemberAlignOption per modificare il valore della proprietà di VCMidlTool.

Lo strumento MIDL non consente limiti di 16 byte.

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à di StructMemberAlignment del compilatore nell'ambiente di sviluppo integrato (IDE):

[Visual Basic]

' 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.StructMemberAlignment = structMemberAlignOption.alignSixteenBytes
    End Sub
End Module

Sicurezza di .NET Framework

Vedere anche

Riferimenti

VCMidlTool Interfaccia

Spazio dei nomi Microsoft.VisualStudio.VCProjectEngine