Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening INI files along with the EXE one
Message
 
To
14/04/1999 17:07:13
Pascal Binette
Pratt & Whitney Canada
Saint-Hubert, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00208396
Message ID:
00208480
Views:
27
>Is there a way of opening an INI file automatically when you run an application that has the same name? I know some other languages such as Delphi have a command for that, but there does not seem to be one in VFP. I looked at the GetPrivateProfileString API function, but you have to specify the path of the file, which is what I want to avoid.

SYS(16,1) will return the full path to the exe. All you then do is replace EXE with INI and you have your full path to ini file. Then you use GetProfileString with this. That's the way I do it (although I've written my own wrapper class for ini files).

Hope this helps,
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Reply
Map
View

Click here to load this message in the networking platform