March 2002
Intermediate to advanced
864 pages
31h 8m
English
MarshalAsAttribute
This optional attribute is used to explicitly specify the unmanaged
type a parameter, field, or return value should be marshaled to.
If you do not specify this attribute, .NET uses the type’s
default marshaler. The
UnmanagedType
enumeration contains the unmanaged types you can marshal to
with this attribute.
public sealed class MarshalAsAttribute : Attribute { // Public Constructors public method MarshalAsAttribute(short unmanagedType); public method MarshalAsAttribute( UnmanagedType unmanagedType); // Public Instance Fields public field UnmanagedType ArraySubType; public field string MarshalCookie; public field string MarshalType; public field Type MarshalTypeRef; public field VarEnum SafeArraySubType; public field Type SafeArrayUserDefinedSubType; public field int SizeConst; public field short SizeParamIndex; // Public Instance Properties public field UnmanagedType Value{get; } }
System.Object→System.Attribute→MarshalAsAttribute
Field, Parameter, ReturnValue