> AddObject('Somestring to display', myObject);
> myObject.Free; //the list owns a reference to it now

you _really_ dont want to do this.. the list now has a pointer to the
object, but its still the same object. if you do the free, then the
list holds an invalid pointer.

> myObject := Listbox1.Objects[ListBox1.Listindex];
this wont compile. you'll need to cast the TObject pointer to the
correct type:

myObject := tRossesObject(Listbox1.Objects[ListBox1.Listindex]);

that should work better..

there are 'nicer' OO ways to do this but it's friday and i'm going now
:-)



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to