> 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"
- Listbox items (Was: Re: [DUG]: array of TStringList) Ross Levis
- RE: Listbox items (Was: Re: [DUG]: array of TStr... Patrick Dunford
- Re: Listbox items (Was: Re: [DUG]: array of TStr... NIRAV KAKU
- Re: Listbox items (Was: Re: [DUG]: array of TStr... Ross Levis
- Re: Listbox items (Was: Re: [DUG]: array of ... Reginald Ebenezer
- RE: Listbox items (Was: Re: [DUG]: array of TStr... James Low
- RE: Listbox items (Was: Re: [DUG]: array of TStr... Ben Taylor
- RE: Listbox items (Was: Re: [DUG]: array of TStr... James Low
- Re: Listbox items (Was: Re: [DUG]: array of TStr... Ross Levis
- RE: Listbox items (Was: Re: [DUG]: array of TStr... Patrick Dunford
- Re: Listbox items (Was: Re: [DUG]: array of TStr... NIRAV KAKU
- RE: Listbox items (Was: Re: [DUG]: array of TStr... Patrick Dunford
- RE: Listbox items (Was: Re: [DUG]: array of TStr... James Low
- RE: Listbox items (Was: Re: [DUG]: array of TStr... Dennis Chuah
- RE: Listbox items (Was: Re: [DUG]: array of ... Patrick Dunford
- Re: Listbox items (Was: Re: [DUG]: array of TStr... Ross Levis
