wchar_t TCHAR and all that

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

wchar_t TCHAR and all that

Postby tofutim » Sat Jul 14, 2012 12:54 am

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: 4852
Joined: Sun Aug 22, 2010 4:28 am

Re: wchar_t TCHAR and all that

Postby FrancescoT » Mon Jul 16, 2012 8:03 am

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 Support

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

Postby tofutim » Wed Jul 18, 2012 10:59 pm

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: 4852
Joined: Sun Aug 22, 2010 4:28 am

Re: wchar_t TCHAR and all that

Postby FrancescoT » Thu Jul 19, 2012 7:51 am

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 Support

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


Return to “Plug-In Development”

Who is online

Users browsing this forum: No registered users and 1 guest