XLL+ Class Library (6.3)

ple::clr::toXl

Transform a value received from .NET to an Excel return value

std::tstring toXl(
   System::String^ str
);
double toXl(
   System::DateTime datevalue
);
double toXl(
   System::DateTime^ dateref
);
double toXl(
   int ival
);
double toXl(
   long lval
);
BOOL toXl(
   bool boolval
);
std::vector<std::tstring> toXl(
   array<System::String^>^ svec
);
std::vector<double> toXl(
   array<System::DateTime>^ dvec
);
std::vector<double> toXl(
   array<int>^ ivec
);
std::vector<double> toXl(
   array<long>^ lvec
);
std::vector<BOOL> toXl(
   array<bool>^ bvec
);
ple::mtx_ptrs<std::tstring> toXl(
   array<System::String^, 2>^ smat
);
ple::mtx_ptrs<double> toXl(
   array<System::DateTime, 2>^ dmat
);
ple::mtx_ptrs<double> toXl(
   array<int, 2>^ imat
);
ple::mtx_ptrs<double> toXl(
   array<long, 2>^ lmat
);
ple::mtx_ptrs<BOOL> toXl(
   array<bool, 2>^ bmat
);

Parameters

str

A CLR string type.

datevalue

A CLR date/time value.

dateref

A CLR date/time reference.

ival

An integer value, which will be converted to a double prior to being returned to Excel.

lval

An integer value, which will be converted to a double prior to being returned to Excel.

boolval

An integer value, which will be converted to a double prior to being returned to Excel.

svec

A CLR single-dimensional array of strings.

dvec

A CLR single-dimensional array of date/time values.

ivec

A CLR single-dimensional array of integer values.

lvec

A CLR single-dimensional array of long integer values.

bvec

A CLR single-dimensional array of boolean values.

smat

A CLR two-dimensional array of strings.

dmat

A CLR two-dimensional array of date/time values.

imat

A CLR two-dimensional array of integer values.

lmat

A CLR two-dimensional array of long integer values.

bmat

A CLR two-dimensional array of boolean values.

Return Value

A standard C++ value or array, that may be passed directly to the CXlOper assignment operator.

Remarks

The various forms of this function transform CLR values or arrays to equivalent C++ types. The transforms are designed to ensure that the correct overload of CXlOper::= will be invoked, when the method is used to return values to Excel, e.g.:

xloResult = toXl(clrValue);

The template function toXl<T> handles the majority of array conversions, where the C++ element type is the same as the CLR element type.

Requirements

Header: xlpclrconvert.h

See Also

Common Language Runtime support functions | objectToXl | toXl<T>