I've been toying with a screen saver for the last couple of days and I've decided it'd be a good idea to keep the config file in the 'APPDATA' folder by reading the environment variable 'APPDATA' to retrieve the path of this folder.
Everything works well and the config file is read when I double click the saver, when I right click and hit 'Test' and when the saver is run via the 'Preview' button on the screen saver properties window.
However, if the saver is allowed to start normally (ie times out), the config file can't be found because 'APPDATA' is returning null.
I've used both 'getenv_()' and GetEnvironmentVariable() to retrieve the variables value, without much success.
Am I missing something here, or has anyone got any ideas?
Cheers....
[edit]
Sorry about the cryptic thread title...It seemed like a good idea at the time. ;o)
I forgot to mention that other environment variables, such as 'USERPROFILE' and 'ALLUSERSPROFILE', work fine.
[/edit]
Everything works well and the config file is read when I double click the saver, when I right click and hit 'Test' and when the saver is run via the 'Preview' button on the screen saver properties window.
However, if the saver is allowed to start normally (ie times out), the config file can't be found because 'APPDATA' is returning null.
I've used both 'getenv_()' and GetEnvironmentVariable() to retrieve the variables value, without much success.
Am I missing something here, or has anyone got any ideas?
Cheers....
[edit]
Sorry about the cryptic thread title...It seemed like a good idea at the time. ;o)
I forgot to mention that other environment variables, such as 'USERPROFILE' and 'ALLUSERSPROFILE', work fine.
[/edit]