I need a function that read all keys (strKey) and values (strWert) in a Dictionary from area (strBereich).
The snippet works fine if I know the area and all keys:
'============================================
'Deklarationen
'--------------------------------------------
'INI Dateien
Private Declare Ansi Function INI_WritePrivateProfileString Lib "[login to view URL]" Alias "WritePrivateProfileStringA" ( _
ByVal lpApplicationName As String, _
ByVal lpKeyName As String, _
ByVal lpString As String, _
ByVal lpFileName As String) As Integer
Private Declare Ansi Function INI_GetPrivateProfileString Lib "[login to view URL]" Alias "GetPrivateProfileStringA" ( _
ByVal lpApplicationName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedString As StringBuilder, _
ByVal nSize As Integer, _
ByVal lpFileName As String) As Integer
'--------------------------------------------
Public Sub INI_Write( _
ByRef strBereich As String, _
ByRef strKey As String, _
ByRef strWert As String, _
ByRef strIniDatei As String)
On Error Resume Next
Call INI_WritePrivateProfileString( _
strBereich, _
strKey, _
strWert, _
strIniDatei)
End Sub
Public Function INI_Read( _
ByRef strBereich As String, _
ByRef strKey As String, _
ByRef strIniDatei As String) As String
On Error Resume Next
Dim sb As New StringBuilder(200)
Dim Ret As Integer = _
INI_GetPrivateProfileString( _
strBereich, _
strKey, _
"?", _
sb, _
200, _
strIniDatei)
'Return [login to view URL]()
INI_Read = [login to view URL]
End Function
----------------------------------------------------------------------
But I only know the area, not the keys.
So I imagine the call:
Dim ret As Integer = getDictionaryOfArea(ByVal strArea as String, ByVal strFileName as String, ByRef dic as Dictionary) as Integer