String,String[] question when interop with tinyfiledialogs #1168
Replies: 1 comment 1 reply
-
|
I would expect tinyfiledialogs.lib to be placed in a directory called These are wrong extern fn char * tinyfd_utf8toMbcs(char * aUtf8string);
extern fn char * tinyfd_utf16toMbcs(CUInt * aUtf16string);//CUInt
extern fn CUInt * tinyfd_mbcsTo16(char * aMbcsString);//CUInt
extern fn char * tinyfd_mbcsTo8(char * aMbcsString);
extern fn CUInt * tinyfd_utf8to16(char * aUtf8string);
extern fn char * tinyfd_utf16to8(CUInt * aUtf16string);//CUIntwchar_t should be replaced by Char16, not CUInt. wchar_t can be replaced by WString and char* by ZString: extern fn char* tinyfd_utf8toMbcs(ZString aUtf8string);
extern fn char * tinyfd_utf16toMbcs(WString aUtf16string);
extern fn WString tinyfd_mbcsTo16(char* aMbcsString);
extern fn ZString tinyfd_mbcsTo8(char* aMbcsString);
extern fn WString tinyfd_utf8to16(ZString aUtf8string);
extern fn ZString tinyfd_utf16to8(WString aUtf16string);
Finally the question is what the functions expect. An Mbcs string? Strings from the source files will be UTF8. extern char tinyfd_needs[]; /* info about requirements */Must be extern char** tinyfd_needs;In C3. For this The simplest solution is to start a new module section which is only visible on Windows: //Windows only section
module tinyfiledialogs @if(env::WIN32);Again all windows functions are incorrect as they use CUInt instead of Char16 (which is an ushort). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I attached the program package here(as I can't upload zip file in discourse) for easy reference.
At this moment,there are 2 issues I am seeking help.It is about string/char* or it is about memory management which is exactly what I would like to learn always. :)
Thanks in advance,
Peter
tinyfiledialogs_test.zip
Beta Was this translation helpful? Give feedback.
All reactions