Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private 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 EscribirIni(ByVal IniFile As String, ByVal Seccion As String, ByVal Clave As String, ByVal Valor As String)
Dim ganar, perder, credito As Long
ganar = WritePrivateProfileString(Seccion, Clave, Valor, IniFile)
credito = WritePrivateProfileString(Seccion, Clave, Valor, IniFile)
perder = WritePrivateProfileString(Seccion, Clave, Valor, IniFile)
End Sub
Private Function LeerIni(ByVal IniFile As String, ByVal Seccion As String, ByVal Clave As String, Optional ByVal DftValor As String) As String
LeerIni = Space(255)
lng1 = GetPrivateProfileString(Seccion, Clave, DftValor, LeerIni, 255, IniFile)
LeerIni = Left(LeerIni, lng1)
End Function