Real Software Forums
http://forums.realsoftware.com/

Getting CSIDL_APPDATA and CSIDL_PERSONAL
http://forums.realsoftware.com/viewtopic.php?f=13&t=41476
Page 1 of 1

Author:  torrid [ Thu Nov 17, 2011 6:43 pm ]
Post subject:  Getting CSIDL_APPDATA and CSIDL_PERSONAL

I am converting a VB6 app to RB... and currently store INI settings files in CSIDL_APPDATA
and also store user data in CSIDL_PERSONAL

I used to hard code those paths but it leads to trouble on Vista and Windows 7.

ANyway, can someone share some code on how to "get" those paths from the registry?
I then need to append the name of the file to open and then open it without any user intervention.

Also what kind of error checking do we use in RB?

In VB6 we always use On error GoTo wrappers to trap errors with file opening....

Author:  timhare [ Thu Nov 17, 2011 6:58 pm ]
Post subject:  Re: Getting CSIDL_APPDATA and CSIDL_PERSONAL

torrid wrote:
I am converting a VB6 app to RB... and currently store INI settings files in CSIDL_APPDATA
and also store user data in CSIDL_PERSONAL

I used to hard code those paths but it leads to trouble on Vista and Windows 7.

ANyway, can someone share some code on how to "get" those paths from the registry?
I then need to append the name of the file to open and then open it without any user intervention.

See SpecialFolder for those paths (and many more). I think you want SpecialFolder.ApplicationData and SpecialFolder.Documents (or maybe SpecialFolder.Desktop).

Quote:
Also what kind of error checking do we use in RB?

In VB6 we always use On error GoTo wrappers to trap errors with file opening....

Use Try/Catch to wrap specific code such as file i/o. You can also put an Exception statement at the end of your method.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/