XLL+ Class Library (7.0)

CXlUserConverterBase<ElemType, XlNativeType>::ConvertToExcel

Converts a single value from a C++ type to Excel format

virtual bool ConvertToExcel(
   const ElemType& outerValue,
   XlNativeType& xlValue,
   const CConvertParamsBase& params
) const;

Parameters

outerValue

A reference to an ElemType value which is to be returned to Excel. This needs to be converted to type XlNativeType

xlValue

A reference to a the target value. If the conversion succeeds, this should be set to the converted value.

params

The conversion parameters supplied for the conversion. These include the argument name, and any extended type parameters set by the developer when the argument was specified.

Return Value

Returns true if the conversion succeeds, and xlValue has been read from outerValue and set to a valid value. Returns false if the conversion fails.

Remarks

This method is only called by the global conversion functions XlWriteScalarEx(), XlWriteVectorEx() and XlWriteMatrixEx(). It does not need to be implemented unless you are intending to return results of the extended type ElemType to Excel. The default implementation of the function fails (returns false).

Requirements

Header: xlpconvert.h

See Also

CXlUserConverterBase<ElemType, XlNativeType> Class | CXlUserConverterBase<ElemType, XlNativeType> Methods