|
-
Aug 28th, 2001, 08:17 AM
#1
Thread Starter
Lively Member
INI Files
I have a program that opens 3 dialogue boxes.
However, I want the paths to these dialogue boxes to be saved to an INI file so that when the user loads the program the next time, the file paths are still intact.
I have seen code to do this, but it's VERY long and I was wondering if there is an easier way?
-
Aug 28th, 2001, 08:23 AM
#2
Fanatic Member
You can actually use SaveSetting which uses the Registry for such simple information. Though if you need to write to an ini, a search would prove fruitful. but here's the code anyway:
Code:
Public Declare Function WritePrivateProfileString Lib "kernel32" _
Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, _
ByVal lpKeyName As Any, ByVal lpString As Any, _
ByVal lpFileName As String) As Long
Private Sub Form_Load()
WritePrivateProfileString "C:\MyINI.ini", "MyFilePath1", Path$
End Sub
Hope that helps you out
-
Aug 28th, 2001, 08:25 AM
#3
Frenzied Member
yes, my mp3 player (shameless advertising ) uses the registry to store data such as that, and the window pos and stuff like that
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 28th, 2001, 08:34 AM
#4
Fanatic Member
The registry is handy and fast for junk like that I use the Registry for my MUD creation tool ZoneWriter to store recent files, paths, window sizing, and preferences. SaveSetting, GetSetting, and DeleteSetting, three very happy functions.
Code:
SaveSetting App.Title, "Paths", "FilePath1", Path$
Path$ = GetSetting(App.Title, "Paths", "FilePath1", App.Path)
DeleteSetting App.Title, "Paths", "FilePath1"
-
Aug 28th, 2001, 09:15 AM
#5
Frenzied Member
i use api reg functions cuz you don't get it all in that sh*t vb and vba section
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 28th, 2001, 09:23 AM
#6
Fanatic Member
True indeed. Could you post examples?
-
Aug 28th, 2001, 09:12 PM
#7
Frenzied Member
um, sorry but actually i can't as i am formatting this computer so currently the only things on it are VC++ and my MP3 Player... so all my source is on a CD-RW somewhere in my room *i can hear my mom saying that ill find it if i clean my room already
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 28th, 2001, 09:26 PM
#8
-
Aug 28th, 2001, 09:27 PM
#9
Frenzied Member
ah, allapi... a resource for everything yeah, i was gunna suggest searching... but then people just b*tch so i just keep my mouth shut
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|