Linking data structures with activex

samm
09-05-2000, 02:18 PM
I've gotten an activex called AddFlo. It allows the user to create collections of parented "nodes" similiar to a tree. Each node contains a publicly accessible property called .UserData, which can contain a Long Integer.

I'd like to create a custom variable (ala type), and somehow "link" this with a node. For example, if my custom structure variable is:
Type customvariable
a as int
b as double
c as string
end

and my node is:
node.index

then I'd like to reach my data via:
mydata = node.index.UserData.a

Is it possible to "attach" the custom structure/type variable to the .UserData field with a pointer or some such thing?

If not, is it possible to "add" my extra data to the node in another way?
Any help is greatly appreciated!

BillSoo
09-05-2000, 05:38 PM
AFAIK, VB does not support pointers. I mean, sure, there is the AddressOf function, but I think that's just for pointers to functions.

The VB way to handle lists is to use an array.

You would have an array of your custom types and store the index of each element in the array in your node.

It's a bit more awkward than true pointers but it should work well enough. If your custom objects have a long lifespan, an array works just as well as a linked list. It's when objects are being created and destroyed (and inserted) that linked lists are superior to a simple array.

"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum