Option Explicit
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 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
'Читаем данные из ini
Function ReadINIKey(FileName As String, Section As String, KeyName As String) As String
Dim RetVal As String
RetVal = String(255, Chr(0))
ReadINIKey = Left(RetVal, GetPrivateProfileString(Section, KeyName, "", RetVal, Len(RetVal), FileName))
End Function
'Записываем данные в ini
Function WriteInIKey(FileName As String, Section As String, KeyName As String, KeyValue As String)
WritePrivateProfileString Section, KeyName, KeyValue, FileName
End Function
В отдельном dll он работает, но очень надо засунуть его в модуль или модуль классов, сам делаю - не работает
ReadINIKey = Left(RetVal, GetPrivateProfileString(Section, KeyName, "", RetVal, Len(RetVal), FileName)) - в этой строчке пишет array expected
Подскажите кто-нибудь, пожалста, в чем дело...