Share via


SafeArrayDefaultRankAttribute Class (2007 System)

Defines the default rank of an array.

Namespace:  Microsoft.VisualStudio.Tools.Applications.Runtime
Assembly:  Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0 (in Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Parameter Or AttributeTargets.ReturnValue, AllowMultiple := False,  _
    Inherited := False)> _
Public NotInheritable Class SafeArrayDefaultRankAttribute _
    Inherits Attribute
'Usage
Dim instance As SafeArrayDefaultRankAttribute
[AttributeUsageAttribute(AttributeTargets.Parameter|AttributeTargets.ReturnValue, AllowMultiple = false, 
    Inherited = false)]
public sealed class SafeArrayDefaultRankAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Parameter|AttributeTargets::ReturnValue, AllowMultiple = false, 
    Inherited = false)]
public ref class SafeArrayDefaultRankAttribute sealed : public Attribute
public final class SafeArrayDefaultRankAttribute extends Attribute

Remarks

For a host application that is based on COM, add the SafeArrayDefaultRank 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 SafeArrayDefaultRank attribute with parameters or return values of type System.Array or System.Object[] that do not convey rank information.

Inheritance Hierarchy

System.Object
  System.Attribute
    Microsoft.VisualStudio.Tools.Applications.Runtime.SafeArrayDefaultRankAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SafeArrayDefaultRankAttribute Members

Microsoft.VisualStudio.Tools.Applications.Runtime Namespace