Discussion:
vb6 api writeprivateprofilesection
(too old to reply)
rpinch
2006-10-26 18:17:01 UTC
Permalink
writeprivateprofilesection in windows 98 replaces the section. in xp it
apparently appends to the section. what's happening, and how do you fix it?
Without that, how do you delete content in a section?
Karl E. Peterson
2006-10-26 18:30:21 UTC
Permalink
Post by rpinch
writeprivateprofilesection in windows 98 replaces the section. in xp
it apparently appends to the section. what's happening, and how do
you fix it? Without that, how do you delete content in a section?
Here's the SectionDelete routine from my INI class:

Public Function SectionDelete(Optional ByVal Section As String, Optional
ByVal FileName As String) As Boolean
' Update cached section and filename, if provided.
Call UpdateFileDetails(Section, FileName)
' Remove specific section from INI file.
SectionDelete = CBool(WritePrivateProfileString(m_Section,
vbNullString, vbNullString, m_FileName))
End Function

Complete work at http://vb.mvps.org/samples/kpIni
--
Working without a .NET?
http://classicvb.org/
Loading...