Can anyone spot why the below function is failing?
It returns true but when looking inside the INI file there's no new added
section.
****CODE****
Public Function WriteINIFileSec tion(ByVal sEntryType As String, ByVal
sKeyName As String, ByVal sFilePath As String) As Boolean
'************** *************** *************** *************** *
' +++ Purpose
'************** *************** *************** *************** *
' Writes a section to an INI file
'************** *************** *************** *************** *
'Declare variables
Dim Response As Integer
Try
'Attempt to write the data to the INI file
Response = WritePrivatePro fileString(sEnt ryType, Nothing, vbNullString,
sFilePath)
'The API call failed
If Response = 0 Then
'Return indicating function has failed
WriteINIFileSec tion = False
Else
'Return indicating function has successfully completed
WriteINIFileSec tion = True
End If
'If there are any errors catch them
Catch e As Exception
MsgBox("The following error occured: " + e.Message, MsgBoxStyle.Cri tical,
"Writing account settings section")
'Return indicating function has failed
WriteINIFileSec tion = False
Exit Function
End Try
End Function
It returns true but when looking inside the INI file there's no new added
section.
****CODE****
Public Function WriteINIFileSec tion(ByVal sEntryType As String, ByVal
sKeyName As String, ByVal sFilePath As String) As Boolean
'************** *************** *************** *************** *
' +++ Purpose
'************** *************** *************** *************** *
' Writes a section to an INI file
'************** *************** *************** *************** *
'Declare variables
Dim Response As Integer
Try
'Attempt to write the data to the INI file
Response = WritePrivatePro fileString(sEnt ryType, Nothing, vbNullString,
sFilePath)
'The API call failed
If Response = 0 Then
'Return indicating function has failed
WriteINIFileSec tion = False
Else
'Return indicating function has successfully completed
WriteINIFileSec tion = True
End If
'If there are any errors catch them
Catch e As Exception
MsgBox("The following error occured: " + e.Message, MsgBoxStyle.Cri tical,
"Writing account settings section")
'Return indicating function has failed
WriteINIFileSec tion = False
Exit Function
End Try
End Function
Comment