wchar_t TCHAR and all that

Interested in developing new plug-ins? Got one to share? Post here!
Post Reply
tofutim
Posts: 176
Joined: Thu Mar 01, 2012 1:16 pm

wchar_t TCHAR and all that

Post 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
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: wchar_t TCHAR and all that

Post 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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
tofutim
Posts: 176
Joined: Thu Mar 01, 2012 1:16 pm

Re: wchar_t TCHAR and all that

Post 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.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: wchar_t TCHAR and all that

Post 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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply