Page 1 of 1

wchar_t TCHAR and all that

Posted: Sat Jul 14, 2012 12:54 am
by tofutim
So, I occasionally run into users whose username is in a foreign language (e.g., Chinese). This means that some paths may need to be Unicode so that the characters turn out as characters instead of ??. That said, the plug-in architecture seems to be based around char *. Is there a way to support these users? My plug-in is current compiled "MultiByte" instead of "Unicode". If I switch to Unicode, I will need to change strings to wstrings, chars to wchar, which is fine, but what is the recommendation from InstallAware's side?

(In particular, I am checking the registry in my app and needing to pull registry values in Unicode instead of single chars - which turns chinese characters into ??)

Thanks in advance,
Tim

Re: wchar_t TCHAR and all that

Posted: Mon Jul 16, 2012 8:03 am
by FrancescoT
Dear Tim,

you can compile your PlugIn using UNICODE, but any call to InstallAware WINAPI Plugin that requires string parameters must be handled as ANSI.

Regards

Re: wchar_t TCHAR and all that

Posted: Wed Jul 18, 2012 10:59 pm
by tofutim
Is it possible to render Unicode text inside of a custom dialog? I'm not sure how to handle if the path contains Chinese characters.

Re: wchar_t TCHAR and all that

Posted: Thu Jul 19, 2012 7:51 am
by FrancescoT
Dear Tim,

I'm not sure what you exactly mean with your question.

If you compile your project as UNICODE, internally with your dialog you can do what you want.
Obviously, any text data that comes from ( ... or passing to ) InstallAwareWINAPI Plugin have to be treated as ANSI.

Regards