Frecko
07-06-2007, 06:39 AM
Component called Microsoft Windows Common Controls 6.0 contains a Treeview control, which has Nodes collection.
Every Node in this collection has .Index property which is of Integer value - max. value being 32767.
However it is possible to add to Treeview much more nodes than that and you can reference them with index numbers greater than 32767, for example:
tview.nodes(34234)
would return a correct node. I find that particulary strange, but since it works, I don't mind.
However:
tview.nodes(34324).Index would return negative value of -31211 (or something like that).
When that happens, it is quite easy to calculate "real" index number (that is 34234), but that way I can only calculate first 65535 nodes in the treeview. I thought that would be enough, but alas it is not so. Data I need to process consists of around 100.000 nodes (or more) and now I have a problem here, because the "real" index number is then quite impossible to calculate.
If I get node number 2000, it is really 2000th node or is it perhaps a node numbered 65535 + 2000?
Does anybody knows a way around this dillema? I suppose MS thought nobody would need a treeview with more than 32k nodes, but files I am getting are enormously big... :(
Every Node in this collection has .Index property which is of Integer value - max. value being 32767.
However it is possible to add to Treeview much more nodes than that and you can reference them with index numbers greater than 32767, for example:
tview.nodes(34234)
would return a correct node. I find that particulary strange, but since it works, I don't mind.
However:
tview.nodes(34324).Index would return negative value of -31211 (or something like that).
When that happens, it is quite easy to calculate "real" index number (that is 34234), but that way I can only calculate first 65535 nodes in the treeview. I thought that would be enough, but alas it is not so. Data I need to process consists of around 100.000 nodes (or more) and now I have a problem here, because the "real" index number is then quite impossible to calculate.
If I get node number 2000, it is really 2000th node or is it perhaps a node numbered 65535 + 2000?
Does anybody knows a way around this dillema? I suppose MS thought nobody would need a treeview with more than 32k nodes, but files I am getting are enormously big... :(