The first problem I encountered was how to display the XML file in memo and treeview components.
I found such a piece of code on the web
FILE * stream;
char FirstLine [512];
OpenDialog1-> Options.Clear ();
OpenDialog1-> Options << ofAllowMultiSelect << ofFileMustExist;
OpenDialog1-> Filter = "Text files (* .txt) | * .txt | All files (*. *) | *. *";
OpenDialog1-> FilterIndex = 2;
if (OpenDialog1-> Execute ())
{
for (int I = 0; I <OpenDialog1-> Files-> Count; I ++)
{
stream = fopen (AnsiString (OpenDialog1-> Files-> Strings [I]). c_str (), "r");
if (stream)
{
fgets (FirstLine, sizeof (FirstLine), stream);
Memo1-> Lines-> Append (firstLine);
fclose (stream);
}
}
}
At the beginning I wanted to display the file in memo and something is displayed but.
First of all, the file is not AnsiString but UTF-8 and secondly, only the first line is displayed in my memo (according to what is written in the code).
You can help because I'm out of ideas.