On Saturday 13 September 2014 4:21:18 PM Geert Janssens wrote:
> Thanks a lot !
> 
> I'll try to apply a similar approach in gnucash for the
> home dir use case.
> 
> For my second case, anybody know how to read an
> environment variable directly in win32 using wide char
> functions ?
> 
> 
> Geert
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

You'd use the GetEnvironmentVariable function. What compiler and IDE are you 
using?

In Windows every API function that deals with text has two variants, so theres 
GetEnvironmentVariableA and GetEnvironmentVariableW.

If you use Visual Studio there's an option on project properties to select the 
encoding and it #defines a symbol that defines the macros to call either 
variant 
and you would use the TCHAR (there's a bunch of typedefs for dealing with 
strings for example LPTSTR, LPSTR, LPWSTR but they all boil down to the same 
thing, in this case LPSTR is typedef for char*, LPWSTR wchar_t*, and LPTSTR is 
char* for ansi and wchar_t* for unicode) type to store the strings (it's a 
typedef for char when using ANSI and wchar_t when using unicode). I'm not sure 
what the symbol is called so if you're not using VS you can just use the wide 
char variants directly or look at the headers and find out what you need to 
define.


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to