conniek
Apr 20th, 2001, 10:48 AM
I am having trouble retrieving from an ini. I only get a blank string. Any help would be appreciated!
Here's my code:
Public 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
buffer = String(145, " ")
rc = GetPrivateProfileString("test", "test", "default", buffer, Len(buffer) - 1, "D:\test.ini")
retstring = Left(buffer, InStr(buffer, " ") - 1)
Here's my code:
Public 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
buffer = String(145, " ")
rc = GetPrivateProfileString("test", "test", "default", buffer, Len(buffer) - 1, "D:\test.ini")
retstring = Left(buffer, InStr(buffer, " ") - 1)