XLL+ Class Library (7.0)

::XlReadGroupedVectorEx

Transform one row or column of a CXlOper into a vector of an extended type

template< class T, class XLT >
void XlReadGroupedVectorEx(
   const CXlOper& xlo,
   std::vector<T>& value,
   const CXlUserConverterBase<T, XLT>& outerConverter,
   const wchar_t* groupName,
   unsigned long rowOrColumn,
   const wchar_t* argName,
   unsigned long flags = 0,
   long* expectedSize = NULL,
   unsigned long lowerBound = 0,
   const T& defaultCellValue = T()
);

Parameters

xlo

A reference to the input passed by Excel.

value

A reference to a variable into which the results will placed, if the conversion is successful.

outerConverter

An instance of the extended type's converter class. See CXlUserConverterBase for details.

groupName

The name of the Excel argument that contains the vector group. This will be used in error messages.

rowOrColumn

The index of the item within the group. Depending on the orientation of the vector group, this may be a row index or a column index.

argName

The name of the item within the group that is being converted. This will be used in error messages, and may also be used to search the grouped input.

flags

A set of flags that control the conversion. See Conversion functions for a list of values.

expectedSize

A pointer to variable that will receive the size of the vector. If it has already been set (i.e. does not have a value of -1), and the size of the vector is not equal to the value. then an exception of type CXlConversionException will be thrown, along with a user-friendly message, such as "Expected 15 items in X". If the pointer is NULL, then the argument will be ignored.

lowerBound

The number of empty items to insert at the start of the result vector. If you are going to pass the vector to a library function that expects vectors to be 1-based, then this value should be set to 1.

defaultCellValue

The default value that will be used for empty cells, if the appropriate flags have been set for the conversion.

Remarks

If the function fails for any reason, an exception of type CXlConversionException is thrown. This will be caught by the outer wrapper function, and converted into an appropriate form to be returned to Excel.

Requirements

Header: xlpconvert.h

See Also

Global conversion functions