LPXLOPER The temporary XLOPER, or 0 if GetTempMemory() failed.
Comments:
(1) This function has the side effect of inserting the byte count as the first character of the created string.
(2) For highest speed, with constant strings, you may want to manually count the length of the string before compiling, and then avoid using this function.
(3) Behavior is undefined for non-null terminated input or strings longer than 255 characters.
Note: If lpstr passed into TempStr is readonly, TempStr will crash your XLL as it will try to modify a read only string in place. strings declared on the stack as described below are read only by default in VC++
char *str = " I am a string"
Use extreme caution while calling TempStr on such strings. Refer to VC++ documentation for complier options to ensure that these strings are compiled as read write or use TempStrConst instead.
TempStr is provided mainly for backwards compatability and use of TempStrConst is encouraged going forward.
TempStr()
Purpose: Creates a temporary string XLOPER