RuntimeInfrastructure mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 System.Enum System.Runtime.InteropServices.ComVisible(true)

Use the enumeration with the attribute to specify how types are marshaled during interoperation with unmanaged code. You can use this enumeration to marshal code using simple value types (I1, I2, I4, I8, R4, R8, U2, U4, and U8), unmanaged types that are unavailable in the .NET Framework, and various miscellaneous types.

For more information, see Interoperating with Unmanaged Code.

Identifies how to marshal parameters or fields to unmanaged code.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType AnsiBStr To be added.

  An ANSI character string that is a length-prefixed single byte. You can use this member on the data type.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType AsAny To be added.

  A dynamic type that determines the type of an object at run time and marshals the object as that type. This member is valid for platform invoke methods only.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType Bool To be added.

  A 4-byte Boolean value (true != 0, false = 0). This is the Win32 BOOL type.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType BStr To be added.

  A Unicode character string that is a length-prefixed double byte. You can use this member, which is the default string in COM, on the data type.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType ByValArray To be added.

  When the property is set to ByValArray, the field must be set to indicate the number of elements in the array. The field can optionally contain the of the array elements when it is necessary to differentiate among string types. You can use this only on an array that whose elements appear as fields in a structure.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType ByValTStr

  .NET Framework 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).

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

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType Currency To be added.

  A currency type. Used on a to marshal the decimal value as a COM currency type instead of as a Decimal.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType CustomMarshaler To be added.

  Specifies the custom marshaler class when used with the or field. The field can be used to pass additional information to the custom marshaler. You can use this member on any reference type.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType Error To be added.

  A native type that is associated with an or an and that causes the parameter to be exported as an HRESULT in the exported type library.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType FunctionPtr To be added.

  An integer that can be used as a C-style function pointer. You can use this member on a data type or on a type that inherits from a .

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType I1 To be added.

  A 1-byte signed integer. You can use this member to transform a Boolean value into a 1-byte, C-style bool (true = 1, false = 0).

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType I2 To be added.

  A 2-byte signed integer.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType I4 To be added.

  A 4-byte signed integer.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType I8 To be added.

  An 8-byte signed integer.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType IDispatch To be added.

  A COM IDispatch pointer (Object in Microsoft Visual Basic 6.0).

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType Interface To be added.

  A COM interface pointer. The of the interface is obtained from the class metadata. Use this member to specify the exact interface type or the default interface type if you apply it to a class. This member produces the same behavior as when you apply it to the data type.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType IUnknown To be added.

  A COM IUnknown pointer. You can use this member on the data type.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType LPArray To be added.

  A pointer to the first element of a C-style array. When marshaling from managed to unmanaged code, the length of the array is determined by the length of the managed array. When marshaling from unmanaged to managed code, the length of the array is determined from the and fields, optionally followed by the unmanaged type of the elements within the array when it is necessary to differentiate among string types.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType LPStr To be added.

  A single byte, null-terminated ANSI character string. You can use this member on the and data types.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType LPStruct To be added.

  A pointer to a C-style structure that you use to marshal managed formatted classes. This member is valid for platform invoke methods only.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType LPTStr To be added.

  A platform-dependent character string: ANSI on Windows 98, and Unicode on Windows NT and Windows XP. This value is supported only for platform invoke and not for COM interop, because exporting a string of type LPTStr is not supported.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType LPWStr

  Note that you cannot use the value with an unmanaged string unless the string was created by using the unmanaged CoTaskMemAlloc function.

  A 2-byte, null-terminated Unicode character string.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType R4 To be added.

  A 4-byte floating-point number.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType R8 To be added.

  An 8-byte floating-point number.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType SafeArray To be added.

  A SafeArray, which is a self-describing array that carries the type, rank, and bounds of the associated array data. You can use this member with the field to override the default element type.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType Struct To be added.

  A VARIANT, which is used to marshal managed formatted classes and value types.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType SysInt To be added.

  A platform-dependent, signed integer: 4 bytes on 32-bit Windows, 8 bytes on 64-bit Windows.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType SysUInt To be added.

  A platform-dependent, unsigned integer: 4 bytes on 32-bit Windows, 8 bytes on 64-bit Windows.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType TBStr To be added.

  A length-prefixed, platform-dependent char string: ANSI on Windows 98, Unicode on Windows NT. You rarely use this BSTR-like member.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType U1 To be added.

  A 1-byte unsigned integer.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType U2 To be added.

  A 2-byte unsigned integer.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType U4 To be added.

  A 4-byte unsigned integer.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType U8 To be added.

  An 8-byte unsigned integer.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType VariantBool To be added.

  A 2-byte, OLE-defined VARIANT_BOOL type (true = -1, false = 0).

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.UnmanagedType VBByRefStr To be added.

  A value that enables Visual Basic to change a string in unmanaged code and have the results reflected in managed code. This value is only supported for platform invoke.

0