Article View: borland.public.cppbuilder.nativeapi
Article #11324Re: TListItems as parametar
From: Dennis Jones
Date: Thu, 19 Feb 2004 07:48
Date: Thu, 19 Feb 2004 07:48
42 lines
1741 bytes
1741 bytes
"ScOe" <cbinders@hotmail.com> wrote in message
news:4033dfcd$3@newsgroups.borland.com...
> What seems to be wrong with this code ?
>
> TListItems *FCurList;
>
> void Init ()
> {
> FCurList = Form1->ListView1->Items;
> }
>
> void func1 ()
> {
> Form1->ListView1->Items = func2 ();
> }
>
> TListItems * __fastcall func2 ();
> {
> FCurList->Clear ();
> TListItem *pItem;
> for (int i=0; i< 10; i++) {
> pItem = FCurList->Add ();
> FCurList->Caption = String (i);
> }
> return FCurList;
> }
>
> this function clears existing listview but does not fill it.
Aside from Remy's comments, I think you need to change this:
> FCurList->Caption = String (i);
to this:
pItem->Caption = String (i);
Otherwise, you are just filling FCurList with blank entries that never get
any text assigned to them.
- Dennis
Technical Details
Message-ID:
<40346a3c@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4033dfcd$3@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,8a4f6862e066e98d X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-18 23:56:28 PST From: "Dennis Jones" <djones@nospam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4033dfcd$3@newsgroups.borland.com> Subject: Re: TListItems as parametar Date: Wed, 18 Feb 2004 23:48:13 -0800 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 204.200.27.7 Message-ID: <40346a3c@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077176892 204.200.27.7 (18 Feb 2004 23:48:12 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail