VBFixedArrayAttribute クラス

定義

構造体または非ローカル変数の配列を固定長配列として扱うことを示します。

public ref class VBFixedArrayAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple=false, Inherited=false)]
public sealed class VBFixedArrayAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple=false, Inherited=false)>]
type VBFixedArrayAttribute = class
    inherit Attribute
Public NotInheritable Class VBFixedArrayAttribute
Inherits Attribute
継承
VBFixedArrayAttribute
属性

Structure Book
    <VBFixedArray(4)> Public Chapter() As Integer
End Structure

Sub WriteData()
    Dim FileNum As Integer = FreeFile()
    Dim MyBook As Book
    ReDim MyBook.Chapter(4)
    ' Add code to populate the array.
    MyBook.Chapter(0) = 1
    MyBook.Chapter(1) = 2
    MyBook.Chapter(2) = 3
    MyBook.Chapter(3) = 4
    MyBook.Chapter(4) = 5
    ' Write the array to a file.
    FileOpen(FileNum, "C:\testfile", OpenMode.Binary,
             OpenAccess.Write, OpenShare.Default)
    FilePut(FileNum, MyBook) ' Write data.
    FileClose(FileNum)
End Sub

注意

VBFixedArrayAttributeは情報であり、ストレージは割り当てられません。 この属性の目的は、 を認識するメソッドまたは API 呼び出しによって構造体と非ローカル変数の配列がどのように使用されるかを VBFixedArrayAttribute変更することです。 この属性は可変長配列を固定配列に変換せず、または ReDim ステートメントを使用して配列ストレージをDim割り当てる必要があることに注意してください。

注釈

Visual Basic 配列は、既定では可変長です。 この属性は、 や FilePutなどの FileGet Visual Basic ファイル入出力関数、および固定長配列を必要とする API 呼び出しを使用する場合に便利です。

コンストラクター

VBFixedArrayAttribute(Int32)

Bounds プロパティの値を初期化します。

VBFixedArrayAttribute(Int32, Int32)

Bounds プロパティの値を初期化します。

プロパティ

Bounds

配列の範囲を返します。

Length

配列のサイズを返します。

TypeId

派生クラスで実装されると、この Attribute の一意の識別子を取得します。

(継承元 Attribute)

メソッド

Equals(Object)

このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。

(継承元 Attribute)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。

(継承元 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。

(継承元 Attribute)

適用対象

こちらもご覧ください