System.Runtime.InteropServices.UnmanagedType.ByValTStr Field

Used for in-line, fixed-length character arrays that appear within a structure. The character type used with UnmanagedType.ByValTStr is determined by the System.Runtime.InteropServices.CharSet argument of the System.Runtime.InteropServices.StructLayoutAttribute attribute applied to the containing structure. Always use the MarshalAsAttribute.SizeConst field to indicate the size of the array.

Value: ByValTStr

Syntax

UnmanagedType ByValTStr

Remarks

.NET Framework UnmanagedType.ByValTStr types behave like C-style, fixed-size strings inside a structure (for example, char s[5]). The behavior in managed code differs from the Microsoft Visual Basic 6.0 behavior, which is not null terminated (for example, MyString As String * 5).

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0