Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Aug 17, 2019 6:10 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Getting CSIDL_APPDATA and CSIDL_PERSONAL
PostPosted: Thu Nov 17, 2011 6:43 pm 
Offline
User avatar

Joined: Sat Jun 04, 2011 8:29 am
Posts: 387
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....

_________________
Currently using:
Windows XP Pro SP3
Real Studio 2011 Release 4.3 Enterprise
and
Mac OS 10.7.4
Real Studio 2011 Release 4.3 Enterprise
(finally also compiled on Mac)


Top
 Profile  
Reply with quote  
 Post subject: Re: Getting CSIDL_APPDATA and CSIDL_PERSONAL
PostPosted: Thu Nov 17, 2011 6:58 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group