LabWindows/CVI

CDotNetCreateArray

int CDotNetCreateArray (unsigned int elementType, size_t numberOfDimensions, ssize_t lowerBounds[], ssize_t lengths[], void *elements, CDotNetHandle *array);

Purpose

Creates a .NET array of the specified fundamental type. To create a .NET array of a specific .NET object type or to create a jagged array (array of arrays), use CDotNetCreateTypedArray.

Parameters

Input
Name Type Description
elementType unsigned int The type of the elements of the .NET array. You can specify one of the following values:

  • CDOTNET_STRING
  • CDOTNET_BOOLEAN
  • CDOTNET_SBYTE
  • CDOTNET_INT16
  • CDOTNET_INT32
  • CDOTNET_INT64
  • CDOTNET_BYTE
  • CDOTNET_UINT16
  • CDOTNET_UINT32
  • CDOTNET_UINT64
  • CDOTNET_SINGLE
  • CDOTNET_DOUBLE
  • CDOTNET_DECIMAL
  • CDOTNET_CHAR
  • CDOTNET_OBJECT
numberOfDimensions size_t The number of dimensions of the .NET array.
lowerBounds ssize_t [] An array containing the lower bound for each dimension of the .NET array. You can pass zero to use the default lower bound (0) for all dimensions.
lengths ssize_t [] An array containing the lengths of each dimension of the .NET array.
elements void * The elements to use to initialize the .NET array. You can pass zero to initialize the array with default values.
Output
Name Type Description
array CDotNetHandle The handle of the array this function creates. You must call CDotNetDiscardHandle to discard this handle when it is no longer needed.

Return Value

Name Type Description
status int A value indicating whether an error occurred. Negative error codes indicate function failure.

Error codes are defined in cvi\include\cvidotnet.h.

You can use CDotNetGetErrorDescription to get the description of an error code.

Additional Information

Library: .NET Library

Include file: cvidotnet.h

LabWindows/CVI compatibility: LabWindows/CVI 8.0 and later