I have declared the following API in a standard module.
Public 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
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

My SACM.INI File is like this
[LISTPRICE]
Sample="LPValue"

In form load i have written some thing like this.

i = WritePrivateProfileString("LISTPRICE", "TRY", "100", App.Path & "\SACM.ini")

lnglen = GetPrivateProfileString("LISTPRICE", "Sample", "", strPath, 7, App.Path & "\SACM.ini")

msgbox strpath

The first statement is going through fine. I am able to write into INI file.
The second statement for reading INI file is failing. The variable strPath is showing any value.


please help me to solve this problem.

chakradhar

Software Engineer
IT Solutions India
Banagalore