by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 17th January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Get an integer data from an INI file using GetPrivateProfileInt API
' Read the "Accesscode" value under the "[Sample]" section
' of the INI file G:\myagent.ini
Dim mycode As Long ' receives the value returned from the INI file
mycode = GetPrivateProfileInt("Sample", "AccessCode", -1, "G:\myagent.ini")
' Display the result
If mycode = -1 Then ' failure
MsgBox "Could not read the information from the INI file."
Else
MsgBox "Access Code = " & mycode
End If
End
End Sub
'Note: Values read are not case sensitive
No comments have been posted about Get an integer data from an INI file using GetPrivateProfileInt API. Why not be the first to post a comment about Get an integer data from an INI file using GetPrivateProfileInt API.