XLL+ Class Library

CXlOper::RetString

Returns a string value to Excel

[C++]
static LPXLOPER RetString(
   const char* lpszFormat,
    ...
);

Parameters

lpszFormat

A string template, which may include tokens preceded by %, like printf.

...

The remaining arguments to the function will be substituted into the returned string, as in the standard C library function printf. Arguments of type CString should be cast to (const char*).

Return value

This function returns a pointer to some static memory containing a string.

Remarks

This static function can be used to return a CXlOper result containing a string from an add-in function, instead of CXlOper::Ret().

For example:

if (input < 0)
    return CXlOper::RetString("#Error: input (%lf) must be >= 0", input);

Requirements

Header: xllplus.h

See Also

CXlOper Class | CXlOper Methods | CXlOper::Ret() | CXlOper::RetError()