共用方式為


VCCLCompilerTool.StructMemberAlignment 屬性

指定 1、 2-、 4-、 8 或結構成員對齊 16 位元組界限。StructMemberAlignment公開 (expose) 功能的 C++ 編譯器的/Zp (結構成員對齊)選項並且 MIDL 編譯器的MIDL 屬性頁:進階選項。

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

語法

'宣告
Property StructMemberAlignment As structMemberAlignOption
structMemberAlignOption StructMemberAlignment { get; set; }
property structMemberAlignOption StructMemberAlignment {
    structMemberAlignOption get ();
    void set (structMemberAlignOption value);
}
abstract StructMemberAlignment : structMemberAlignOption with get, set
function get StructMemberAlignment () : structMemberAlignOption
function set StructMemberAlignment (value : structMemberAlignOption)

屬性值

型別:Microsoft.VisualStudio.VCProjectEngine.structMemberAlignOption
structMemberAlignOption 值。

備註

[MIDL] 工具不允許 16 位元組的界限。

範例

請參閱HOW TO:編譯專案模型擴充性的範例程式碼如需有關如何編譯及執行這個範例資訊。

下列範例會修改編譯器的StructMemberAlignment在整合式的開發環境 (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.StructMemberAlignment = structMemberAlignOption.alignSixteenBytes
    End Sub
End Module

.NET Framework 安全性

請參閱

參考

VCCLCompilerTool 介面

Microsoft.VisualStudio.VCProjectEngine 命名空間