Share via


SafeArrayDefaultRankAttribute Class

Definition

Defines the default rank of an array.

public ref class SafeArrayDefaultRankAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue, AllowMultiple=false, Inherited=false)]
public sealed class SafeArrayDefaultRankAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue, AllowMultiple=false, Inherited=false)>]
type SafeArrayDefaultRankAttribute = class
    inherit Attribute
Public NotInheritable Class SafeArrayDefaultRankAttribute
Inherits Attribute
Inheritance
SafeArrayDefaultRankAttribute
Attributes

Remarks

For a host application that is based on COM, add the SafeArrayDefaultRankAttribute attribute in the proxy code to marshaled safe array parameters or return values to specify the actual rank of the arrays in question. This is needed because there is no differentiation between one-dimensional and multi-dimensional arrays in the COM type library. The COM safe arrays are converted to one-dimensional arrays in the proxy code by default. Also, use the SafeArrayDefaultRankAttribute attribute with parameters or return values of type Array or System.Object[] that do not convey rank information.

Constructors

SafeArrayDefaultRankAttribute(Int32)

Initializes a new instance of the SafeArrayDefaultRankAttribute class with a default rank.

Properties

DefaultRank

Gets the default rank of the array.

Applies to