tfussell / xlnt

:bar_chart: Cross-platform user-friendly xlsx library for C++11+
Other
1.49k stars 418 forks source link

I use xlnt with ue4. but it crashed. #577

Open whysay opened 3 years ago

whysay commented 3 years ago

Build the dll and use ue4 3rd party.

FString ue4_string(UTF8_TO_TCHAR(cell.to_string().c_str()));

ue4_string is fine. However, it crashed when ue4_string called its destructor.

I think it's because of compatibility of string return.

I added the below function to the cell class and it works fine.

Could you please add a similar function?

void cell::getChar(char outChar, int max_size / = 256*/) { strcpy_s(outChar, max_size, to_string().c_str()); }

use it in ue4 code

char outChar[256]; cell.getChar(outChar); FString ue4_string(UTF8_TO_TCHAR(outChar));