Ok, So i'm creating a class that loads DirectX materials from an XML document into a hash file and then spits the materials back out.
this is how i hav it set up...
first i create my hashtable
Hashtable iMaterials = new Hashtable();
than i take teh material that i've pulled from the XML file im calling it Tmaterial and matName is a string (i've already checked to make sure it creates the material properly)
iMaterials.Add(matName, Tmaterial);
this part SEEMS to work properly... however when i try to get the material out again...
Material temp = iMaterials["Red"];
i know that there is a key called "Red".
Visual Studio gives me this...
Cannot implicitly convert type 'object'
so i tryed this...
Material temp = (Material)iMaterials["Red"];
and i get...
A first chance exception of type 'System.NullReferenceException'
am i just useing HashTable wrong??
Any help would be appricated!