I need to store references to interfaces in a list so that when the user selects a list item I can easily access the interface that relates to that item. I’ve been casting the interface as a pointer and adding it as the list items object. Now when I try to retrieve it I try to cast it back and the compiler moans that you cant cast a TObject to an interface. I tried casting it to a pointer first and then to the interface type which the compiler likes (see code below). The problem I have then is that when the code runs, when the following line runs it throws an exception. My question is, Is there a better way to do what I need to do and what is causing the problem with this code. I must say that I’m not 100% when it comes to interfaces.

Item := IJanusDataSourceItem (pointer (ListItemObject)) ;