home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!waikato.ac.nz!canterbury.ac.nz!lincoln.ac.nz!cachoo
- Newsgroups: comp.lang.pascal
- Subject: Re: TDialog.SetData & Listboxes
- Message-ID: <1992Sep7.170606.253@lincoln.ac.nz>
- From: cachoo@lincoln.ac.nz
- Date: 7 Sep 92 17:06:05 +1200
- References: <RTBkqB1w164w@bowker.com>
- Lines: 27
-
- In article <RTBkqB1w164w@bowker.com>, jnicholson@bowker.com (Jim Nicholson) writes:
- > Here's a TVision question.
- >
- > I appear to be having a problem getting TDIalog.SetDAta to initialize a
- > listbox. I've got a simple dialog containing a listbox and two buttons. My
- > transfer record looks like
- > DataRec : record
- > ListBoxVals : TListBoxRec;
- > end;
- > I've defined TListBoxRec as per BI tech support (it's a record containing a
- > PString collection and a Word);
- ... stuff deleted...
- > This approach works for any control type other than TListBOx. Can someone
- > help?
-
- You don't give enough info to determine what the problem is. One possibility
- is that you are using an INSTANCE of TCollection, instead of creating a
- DESCENDANT. Since TCollection is an ABSTRACT type, when you call
- TListBox.NewList with a Nil argument (which is supposed to delete the list)
- funny things can happen. If you have a collection of strings created with NewStr
- then you need to create a descendant of TCollection where the FreeItem method
- calls DisposeStr. Otherwise only TObject.Done will be called and you'll wind
- up with a mess!
-
- Hope this helps
- Oscar
-
-