Hi List!
I have a dictionary with an integer key (itemID, parentID below) and a
custom class as value.
I want to use it for quick lookup.
However I get an illegalCastExeption:
dim node As cItemNode = new cItemNode(itemID, parentID, Name)
pidHash.Value(itemID) = node
...
if pidHash.HasKey(parentID) then
' dim pNode As cItemNode = pidHash.Value(parentID) '
illegalCastExeption here
dim pNode As cItemNode = cItemNode(pidHash.Value(parentID)) '
illegalCastExeption here
end
However the following code using a Variant does work:
dim tmp as Variant = new cItemNode(itemID, parentID, Name)
cItemNode(tmp).AddChild tmp
What's wrong with the dictionary usage here?
TIA,
Tom
PS. RB 2006r1 on Mac OS X 10.4.5
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>