first_is attribute
The [first_is] attribute specifies the index of the first array element to be transmitted.
first_is(limited-expression-list)
Parameters
-
limited-expression-list
-
Specifies one or more C-language expressions. Each expression evaluates to an integer that represents the array index of the first array element to be transmitted. The MIDL compiler supports conditional expressions, logical expressions, relational expressions, and arithmetic expressions. MIDL does not allow function invocations in expressions and does not allow increment and decrement operators. Separate multiple expressions with commas.
Remarks
If the [first_is] attribute is not present, or if the specified index is a negative number, array element zero is the first element transmitted.
The [first_is] attribute can also help determine the values of the array indexes corresponding to the [last_is] or [length_is] attribute when these attributes are not specified. The relationship between these array indexes is:
length = last - first + 1
The following relationship must also hold:
0 <= first_is <= max_is
The following relationship must hold when [max_is] <= 0:
first_is == 0
The [first_is] attribute cannot be used at the same time as the [string] attribute.
Using a constant expression with the [first_is] attribute is an inappropriate use of the attribute. It is legal, but inefficient, and will result in slower marshaling code.
Examples
HRESULT Proc1(
[in] short First,
[first_is(First)] Arr[10]);
See also