LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

IniFile.fp, Funktion "ini_NthSectionName", Parametertypen

Using LabWindows/CVI on a Windows2000 OS.
To read or write Ini-Style files, there is the the "inifile.fp"driver.
To get a Name of the String enclosed by the Brackets (Sectionname), I use the function: "Ini_NthSectionName" with the parameters IniText(Handle of the whole Object), Index(the Nth sectionname) and SectionName(Pointer to the String).
If I use a char Pointer for SectionName, I get the errormessage: "Get Pointer to char, expected Pointer To Pointer to char". Whats wrong, Pointer To Pointer to char is a Pointer to a stringarray, and not a pointer to a string.
0 Kudos
Message 1 of 3
(3,035 Views)
The inifile.fp does not return to you a local copy of the string into a char *. It returns a pointer to the section name string that is internally stored in the internal structure used by inifile.fp. Therefore it returns a pointer to the string which is a char **. So, you should be passing in a char* by reference to the function. For example,

Ini_NthSectionName (g_myInifile, section, &sectionName);

where sectionName is a char *.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 3
(3,035 Views)
The inifile.fp does not return to you a local copy of the string into a char *. It returns a pointer to the section name string that is internally stored in the internal structure used by inifile.fp. Therefore it returns a pointer to the string which is a char **. So, you should be passing in a char* by reference to the function. For example,

Ini_NthSectionName (g_myInifile, section, &_sectionName);

where _sectionName is a char *.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 3 of 3
(3,035 Views)