I am having big problems with a TreeView component in C++Builder.
Basically I have a database table and I am trying to populate a tree based on the contents of the table. I take a directory string from the table, split it up, and then make nodes out of each of the strings, so
C:\ajm\test\001.png would give me
+ C
+ ajm
+ test
I then add the filename as a leaf. I've overcome the first hurdle of checking for duplicates so as not to create multiple nodes for files in the same directory, but my code is still not correct.... for a given list of files my output is something like this:
c:\ajm\test\001.png
c:\ajm\test\002.png
c:\ajm\images\1.bmp
c:\ajm\006.mpeg
gives
+ C
+ ajm
+ test
001.png
002.png
+ images
1.bmp
006.mpeg
so if there is more than one file with the same directory path the tree is not created correctly.
Does anyone out there have any advice or ideas on why this could be? I can post some code if necessary
Thanks
Basically I have a database table and I am trying to populate a tree based on the contents of the table. I take a directory string from the table, split it up, and then make nodes out of each of the strings, so
C:\ajm\test\001.png would give me
+ C
+ ajm
+ test
I then add the filename as a leaf. I've overcome the first hurdle of checking for duplicates so as not to create multiple nodes for files in the same directory, but my code is still not correct.... for a given list of files my output is something like this:
c:\ajm\test\001.png
c:\ajm\test\002.png
c:\ajm\images\1.bmp
c:\ajm\006.mpeg
gives
+ C
+ ajm
+ test
001.png
002.png
+ images
1.bmp
006.mpeg
so if there is more than one file with the same directory path the tree is not created correctly.
Does anyone out there have any advice or ideas on why this could be? I can post some code if necessary
Thanks