I have a c++ program which launch a Delphi DLL where there are informations i need in C++.
So I need to return data from Delphi to C++.
I make some tries, and the last succefull try was to pass a c++ pointer to function and use the function in the delphi side;
Until Now, everything is OK;
the problem occurs when i try to send string from Delphi to C++; I receive non comprehensible string; ( chinese letters + arabic letters + mathmatical symbols ).
after several tries; I noticed that in Delphi, the problem occurs if there is a UnicodeString or String in the program even if it is not in the string sent to C++.
If I have only PWideChar in the program, that works; if there is String or UnicodeString, AnsiString ..., (even if it is not concatenated to PWideChar), the received string is unreadable.
I hope find a solution for this problem. I will put some code in commentaires.