Read INI-Section with API-function
Posted: Sat Sep 28, 2013 10:03 pm
Hello to all !
Maybe someone has a solution for this Problem.
I need to read all keys and values of a specified INI-Section. So I try to use the API-function "GetPrivateProfileSection".
This is the declaration:
Declare GetPrivateProfileSection as "GetPrivateProfileSectionA" of "kernel32.dll"
lpAppName As String
lpReturnedString As String
nSize As Long
lpFileName As String
result as long
End Declare
Later in the code I use this function:
Dim szBuf as String
GetPrivateProfileSection.lpAppName = "MainMenu"
GetPrivateProfileSection.lpReturnedString = szBuf
GetPrivateProfileSection.nSize = 255
GetPrivateProfileSection.lpFileName = "C:Test.ini"
GetPrivateProfileSection.Execute
The variable szbuf is needed in the function for the returned string after reading the section.
In VB it is declared as: Dim szBuf as String * 255
How this can be done in FNXBasic?
Will the returned string will be in the variable szBuf?
Thank you for your answers.
Gerhard
Maybe someone has a solution for this Problem.
I need to read all keys and values of a specified INI-Section. So I try to use the API-function "GetPrivateProfileSection".
This is the declaration:
Declare GetPrivateProfileSection as "GetPrivateProfileSectionA" of "kernel32.dll"
lpAppName As String
lpReturnedString As String
nSize As Long
lpFileName As String
result as long
End Declare
Later in the code I use this function:
Dim szBuf as String
GetPrivateProfileSection.lpAppName = "MainMenu"
GetPrivateProfileSection.lpReturnedString = szBuf
GetPrivateProfileSection.nSize = 255
GetPrivateProfileSection.lpFileName = "C:Test.ini"
GetPrivateProfileSection.Execute
The variable szbuf is needed in the function for the returned string after reading the section.
In VB it is declared as: Dim szBuf as String * 255
How this can be done in FNXBasic?
Will the returned string will be in the variable szBuf?
Thank you for your answers.
Gerhard