Export (0) Print
Expand All

TypeBuilder.DefineInitializedData Method

Defines initialized data field in the .sdata section of the portable executable (PE) file.

[Visual Basic]
Public Function DefineInitializedData( _
   ByVal name As String, _
   ByVal data() As Byte, _
   ByVal attributes As FieldAttributes _
) As FieldBuilder
[C#]
public FieldBuilder DefineInitializedData(
 string name,
 byte[] data,
 FieldAttributes attributes
);
[C++]
public: FieldBuilder* DefineInitializedData(
 String* name,
 unsigned char data __gc[],
 FieldAttributes attributes
);
[JScript]
public function DefineInitializedData(
   name : String,
 data : Byte[],
 attributes : FieldAttributes
) : FieldBuilder;

Parameters

name
The name used to refer to the data. name cannot contain embedded nulls.
data
The blob of data.
attributes
The attributes for the field.

Return Value

A field to reference the data.

Exceptions

Exception Type Condition
ArgumentException Length of name is zero.

-or-

The size of the data is less than or equal to zero or greater than or equal to 0x3f0000.

ArgumentNullException name or data is a null reference (Nothing in Visual Basic).
InvalidOperationException CreateType has been previously called.

Remarks

The field that you create with this method will be static (Shared in Visual Basic), even if you do not include FieldAttributes.Static in the attributes parameter.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

TypeBuilder Class | TypeBuilder Members | System.Reflection.Emit Namespace

Show:
© 2014 Microsoft