Using VB4 in both W95 and W3.1 environments.
I want to keep my .ini file in my application directory to allow
multiple installations of the same product on the same machine,
each with their own "personality". I cannot get the DeleteSetting
statement to work when the ini file is in the application directory.
Any clues would be appreciated.
Sample code:
Private Sub MakeIniSection(MyAppName As String, SectName As String)
SaveSetting MyAppName, SectName, "Entry01", "First entry"
SaveSetting MyAppName, SectName, "Entry02", "Second entry"
SaveSetting MyAppName, SectName, "Entry03", "Third entry"
End Sub
Private Sub TestIniDelete()
' following three lines work for writing a file to windows
' directory, then deleting the first section created
MakeIniSection "INITEST", "Section01"
MakeIniSection "INITEST", "Section02"
DeleteSetting "INITEST", "Section01"
' first two lines work; write settings to directory containing
' the executable. Third line fails with Run Time error '5'
' Invalid procedure call
MakeIniSection ".\INITEST", "Section01"
MakeIniSection ".\INITEST", "Section02"
DeleteSetting ".\INITEST", "Section01"
End Sub
--
Dennis Galvin