I have one record type. I want to add the variable of that record type in TListbox and retrieve it on click event of TListbox. Is it possible? If yes then how?
I added it using
lstbox.AddItem(data,myrec);
It shows error of incompatible types. data is string and myrec is variable of MyRecord which I have created.
For adding:
New(fptr1);
ZeroMemory(fptr1,sizeof(fptr1^));
fptr1^ := fptr^;
lstboxLeft.AddItem(path,TObject(fptr1));
For retrieve:
fptr := PData(lstboxLeft.Items[lstboxLeft.ItemIndex]);