次の方法で共有


StructLayoutAttribute.Size フィールド

クラスまたは構造体の絶対サイズを示します。

Public Size As Integer
[C#]
public int Size;
[C++]
public: int Size;
[JScript]
public var Size : int;

解説

すべてのメンバの合計以上にする必要があります。このフィールドは主にコンパイラ ライタでクラスまたは構造体の合計サイズ (バイト数) を指定するために使用しようします。構造体が占有しているメモリを直接アンマネージ アクセスできるように拡張するときに使用できます。たとえば、メタデータに直接表現されない共用体を操作するときにこのフィールドを使用できます。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard

参照

StructLayoutAttribute クラス | StructLayoutAttribute メンバ | System.Runtime.InteropServices 名前空間