I'm new to the LMD components and I'm confused about UnicodeStrings. I had troubles to insert an UnicodeString into a cell of a grid.
Grid->Cells[PathCol->Position][i] = L"testpath";
produced some additonal garbage characters. Then I found the following link:
Do I really have to use LMDUnicodeStrings? If yes, then please give me a code snippet, how to convert beween Delphi UnicodeString and LMDUnicodeStrings and back. Or do I have to recompile the packages with special definitions. At the moment I'm working with the lib files that were installed with setupvcl17d25.exe. I'm using C++Builder 10.2 Tokyo.
Comments
C++ prefix L represents wide-character strings, not UnicodeStrings. Please read:
http://docwiki.embarcadero.com/RADStudio/Tokyo/de/String-Typen_(Delphi) or
http://docwiki.embarcadero.com/RADStudio/Tokyo/de/Unicode_in_RAD_Studio
Since Delphi/C++Builder 2009 standard string type is UnicodeString (which is supported by TLMDGrid as default conversion from/to Variant data type).
If you need explicitely WideString support, write your own custom datasource (small example is in Grid demo included, can be certainly in-memory as well).
Now I have reinstalled everything and the following works:
BTW: wchar_t arrays can be assigned as well to WideString's as to UnicodeString's.
Thank you!