Re: GLib 2.2.0, GTK+ 2.2.0

"alex_shaduri <[email protected]>" <[email protected]>
Newsgroups gmane.comp.video.gimp.windows.devel
Message-ID <[email protected]>
--- In [email protected], Tor Lillqvist <tml@i...> wrote:
>  > Another problem is g_get_home_dir(). Every time I try to call it my
>  > app segfaults.
> 
> Are there segfaults on Windows? ;-)
> 
Yes, if you're linking to SDL. At least SDL says so.

>  > I checked the source and noticed that it checks for
>  > some env. variables, which may work in win2k but are unavailable in
>  > win98.
> 
> Yes, I know.
> 
>  > I think this function should return something like "c:\my
>  > documents" or similar (I recall there was some registry key that
>  > set this directory in w98, but I don't remember it exactly).
> 
> If you find out, please inform me and I can add code for that.

The registry keys are (both will do):
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\, value 'Personal'
and
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\, value 'Personal'.
I got them from some app that let the user change his "home". This app works in all versions of windows from 95 (including XP), so I think these keys are good sources to get this info.

btw, is there any way to get some registry data through glib? I know about g_win32_get_package_installation_directory(), but it only searches at the specific location.

> Does your app crash because g_get_home_dir() returns NULL? You need to
> check for a NULL return value...
Oops, sorry, I didn't check that...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.