Skip to content

Latest commit

 

History

History
99 lines (85 loc) · 2.46 KB

File metadata and controls

99 lines (85 loc) · 2.46 KB
title first_is | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
vc-attr.first_is
dev_langs
C++
helpviewer_keywords
first_is attribute
ms.assetid 89acbf56-3b38-4d44-83e8-1ce2f6f74ffd
caps.latest.revision 9
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

first_is

Specifies the index of the first array element to be transmitted.

Syntax

  
      [ first_is(  
   "expression"  
) ]  

Parameters

expression
One or more C-language expressions. Empty argument slots are allowed.

Remarks

The first_is C++ attribute has the same functionality as the first_is MIDL attribute.

Example

The following code shows various ways to specify a section in an array:

// cpp_attr_ref_first_is.cpp  
// compile with: /LD  
#include "windows.h"  
#include "unknwn.h"  
  
[module(name="MyLib")];  
  
[object, uuid(11111111-1111-1111-1111-111111111111)]  
__interface b   
{  
   [id(0), propget, bindable, displaybind, defaultbind,   
requestedit] HRESULT get_I([out, retval]long *i);  
   HRESULT Proc1([in] short First, [in] short Last,   
[first_is(First), last_is(Last), size_is(Last-First)] char Arr1[]);   
   HRESULT Proc2([in] short First, [in] short Last,   
[last_is(First), size_is(Last)] char Arr2[]);  
};  

Requirements

Attribute Context

Applies to Field in struct or union, interface parameter, interface method
Repeatable No
Required attributes None
Invalid attributes None

For more information, see Attribute Contexts.

See Also

IDL Attributes
Typedef, Enum, Union, and Struct Attributes
Parameter Attributes
last_is
max_is
length_is
size_is