August 2003
Intermediate to advanced
928 pages
32h 1m
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 MarshalAsAttribute(shortunmanagedType); public MarshalAsAttribute(UnmanagedTypeunmanagedType); // Public Instance Fields public UnmanagedType ArraySubType; public string MarshalCookie; public string MarshalType; public Type MarshalTypeRef; public VarEnum SafeArraySubType; public Type SafeArrayUserDefinedSubType; public int SizeConst; public short SizeParamIndex; // Public Instance Properties public UnmanagedType Value{get; } }
System.Object
→
System.Attribute
→
MarshalAsAttribute
Field, Parameter, ReturnValue