If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Typecasting Object to Struct.

By the looks of it... everything is wrong with it...
Could you post the code that actually adds the elements to the linked list, so we can have a look?
The exception means that the Data object is not of the Vals type (I'm guessing it's actually a string). It seems to me that you have some misconceptions about what structs are, and how they should be used.

Re: Typecasting Object to Struct.

Originally Posted by TheGreatCthulhu

By the looks of it... everything is wrong with it...
Could you post the code that actually adds the elements to the linked list, so we can have a look?
The exception means that the Data object is not of the Vals type (I'm guessing it's actually a string). It seems to me that you have some misconceptions about what structs are, and how they should be used.

I'm not sure if I get what youre saying. The Data object has been passed a Vals.