FieldOffsetAttribute クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<ComVisibleAttribute(True)> _ <AttributeUsageAttribute(AttributeTargets.Field, Inherited:=False)> _ Public NotInheritable Class FieldOffsetAttribute Inherits Attribute
[ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets.Field, Inherited=false)] public sealed class FieldOffsetAttribute : Attribute
[ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets::Field, Inherited=false)] public ref class FieldOffsetAttribute sealed : public Attribute

この属性は、System.Runtime.InteropServices.StructLayoutAttribute の LayoutKind.Explicit がコンストラクタに渡されたときに使用され、クラスまたは構造体に適用して、そのクラスまたは構造体のアンマネージ表現内の各非 static メンバまたは定数メンバのオフセットを指定します。

明示的なレイアウトを持つクラスのメンバに FieldOffsetAttribute を適用する方法を次の例に示します。
<StructLayout(LayoutKind.Explicit)> _ Public Class SYSTEM_INFO <FieldOffset(0)> Private OemId As System.UInt64 <FieldOffset(4)> Private PageSize As System.UInt64 <FieldOffset(16)> Private ActiveProcessorMask As System.UInt64 <FieldOffset(20)> Private NumberOfProcessors As System.UInt64 <FieldOffset(24)> Private ProcessorType As System.UInt64 End Class
[StructLayout(LayoutKind.Explicit)] public class SYSTEM_INFO { [FieldOffset(0)] public ulong OemId; [FieldOffset(4)] public ulong PageSize; [FieldOffset(16)] public ulong ActiveProcessorMask; [FieldOffset(20)] public ulong NumberOfProcessors; [FieldOffset(24)] public ulong ProcessorType; }
[StructLayout(LayoutKind::Explicit)] public ref class SYSTEM_INFO { public: [FieldOffset(0)] UInt64 OemId; [FieldOffset(4)] UInt64 PageSize; [FieldOffset(16)] UInt64 ActiveProcessorMask; [FieldOffset(20)] UInt64 NumberOfProcessors; [FieldOffset(24)] UInt64 ProcessorType; };
/** @attribute StructLayout(LayoutKind.Explicit) */ public class SYSTEM_INFO { /** @attribute FieldOffset(0) */ public long oemId; /** @attribute FieldOffset(4) */ public long pageSize; /** @attribute FieldOffset(16) */ public long activeProcessorMask; /** @attribute FieldOffset(20) */ public long numberOfProcessors; /** @attribute FieldOffset(24) */ public long processorType; } //SYSTEM_INFO

System.Attribute
System.Runtime.InteropServices.FieldOffsetAttribute


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からFieldOffsetAttribute クラスを検索する場合は、下記のリンクをクリックしてください。

- FieldOffsetAttribute クラスのページへのリンク