Referring to the Code below, how would you retrieve the structure of 'a' back from its memory address stored in the the ItemData Property of a ListBox (or any other control.) CopyMemory and MoveMemory will not work because of the strings/arrays of string stored in the structure. Is there a way to TypeCast a value in VB? Or is there any other way to store a structure in the ItemData
Property of a ListBox that is retrievable?

Thanks, Trent

Dim tArr() As String

Type t
i As Integer
s As String
arr As tArr
End Type

Dim a As t, b As t

Private Function SomeFunc
Dim lb As ListBox, nSize As Long
Dim SomeArray() As String

Redim SomeArray(10)

' Input Dummy Values
a.i = 1
a.s = "One"
a.arr = SomeArray

lb.AddItem vbNullString ' Add a blank item to the List Box
lb.ItemData(0) = VarPtr(a) ' Add a pointer to the Structure a to the ItemData proprerty using varPtr

b = lb.ItemData(0) ' ? Incompatible data types
nSize = len (b) ' Get the size of the data structure.
b = CopyMemory(b, lb.ItemData(0), nSize) ' Takes this as a literal 'Long' instead of a structure

End Function