XLL+ Class Library (6.3)

ple::clr::toClr

Transform a value received from Excel to a CLR form

System::String^ toClr(
   const CXlStringArg& arg
);
System::String^ toClr(
   const std::string& str
);
System::String^ toClr(
   const std::wstring& wstr
);
System::String^ toClr(
   const CString& cstr
);
System::String^ toClr(
   const CStringA& cstra
);
System::String^ toClr(
   const CStringW& cstrw
);
System::String^ toClr(
   const char* psz
);
System::String^ toClr(
   const wchar_t* wpsz
);
array<System::String^>^ toClr(
   const std::vector<CString>& vector
);
array<System::String^, 2>^ toClr(
   const ple::mtx_ptrs<CString>& matrix
);

Parameters

arg

A string argument received from Excel.

str

An STL string.

wstr

An STL wide string.

cstr

A string object, whose character type depends on the value of the pre-processor definition _UNICODE.

cstra

A string object.

cstrw

A unicode string object.

psz

A non-zero, null-terminated character array.

wpsz

A non-zero, null-terminated wide character array.

vector

A vector of string objects, whose character type depends on the value of the pre-processor definition _UNICODE.

matrix

A matrix of string objects, whose character type depends on the value of the pre-processor definition _UNICODE.

Return Value

A CLR object, that may be passed directly to a .NET method, using C++/CLI.

Remarks

The various forms of this function transform C++ string types or arrays to equivalent .NET string or array.

The template function toClr<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 | toClr<T>