Re: gtk win32 and env variables

2005-11-06 Thread Dan McMahill
Tor Lillqvist wrote: Dan McMahill writes: > On windows, it is easy for the user to pick a different place to > install so I need to set those variables. > So my question is how do gtk apps ported to windows typically deal with > something like that? Typically they assume that all the appl

Re: gtk win32 and env variables

2005-11-06 Thread John Cupitt
On 11/6/05, Tor Lillqvist <[EMAIL PROTECTED]> wrote: > > Another solution for applications is to look at argv[0]. On > > Windows this is always (I think) the full path to the .exe. > > Looking at argv[0] is really not recommended on Windows. If memory > serves me right, if the path to the applicati

Re: gtk win32 and env variables

2005-11-05 Thread Tor Lillqvist
> Another solution for applications is to look at argv[0]. On > Windows this is always (I think) the full path to the .exe. Looking at argv[0] is really not recommended on Windows. If memory serves me right, if the path to the application has spaces in it, it might even be that depending on the ph

Re: gtk win32 and env variables

2005-11-05 Thread Eduardo M KALINOWSKI
David Necas (Yeti) wrote: > >Or have a look at g_win32_get_package_installation_directory(). >Calling it with NULL arguments is usually sufficient. *Not* >storing the directory in registry has the advantage the app >can be moved around freely without breaking it (of course, >if it's not prevented

Re: gtk win32 and env variables

2005-11-05 Thread John Cupitt
On 11/5/05, David Necas (Yeti) <[EMAIL PROTECTED]> wrote: > On Sat, Nov 05, 2005 at 03:40:40PM +0100, Goran Rakić wrote: > > > > Put this first: > > > > ... (some win32 registry code) ... > > Or have a look at g_win32_get_package_installation_directory(). Very neat. Another solution for applicatio

Re: gtk win32 and env variables

2005-11-05 Thread Goran Rakić
On 05.11.2005., at 16.09, David Necas (Yeti) wrote: g_win32_get_package_installation_directory I did not know for this function. It is nice to have it around. Goran Rakic ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mai

Re: gtk win32 and env variables

2005-11-05 Thread David Necas (Yeti)
On Sat, Nov 05, 2005 at 03:40:40PM +0100, Goran Rakić wrote: > > Put this first: > > ... (some win32 registry code) ... Or have a look at g_win32_get_package_installation_directory(). Calling it with NULL arguments is usually sufficient. *Not* storing the directory in registry has the advantage

Re: gtk win32 and env variables

2005-11-05 Thread Goran Rakić
Put this first: #ifdef WIN32 # include # include #endif And latter in your code... #ifdef WIN32 // Fallback value: data in working dir char dbpath[MAX_PATH]="data"; HKEY hkResult; DWORD DataType; DWORD DataCount = MAX_PATH; // Open registry key if (RegOpen