BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TListView and Threads

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
Hugo Oliveira Dias
Guest





PostPosted: Sat Aug 16, 2003 12:46 pm    Post subject: TListView and Threads Reply with quote



I've a ListView with queued downloads. When i start transfer, the
downloading
thread updates some fields and a progess bar in the Listview.

When i start the thread i give it the ListItem->Index. During the download,
if i insert another item in the Listview, it updates the wrong item.

Anyone as a good solution for this ?

Thanks in advance,

Hugo Oliveira Dias


Back to top
Yahia El-Qasem
Guest





PostPosted: Sat Aug 16, 2003 1:06 pm    Post subject: Re: TListView and Threads Reply with quote



I won't give it the index but a pointer to the ListItem... this way you
always have the right item for updating etc AFAIK...

I would think that you need to use Synchronize when updating the ListItem
from the thread...

Just some guesses...

Yahia

"Hugo Oliveira Dias" <hugo.dias (AT) no-spam (DOT) pluricanal.net> schrieb im
Newsbeitrag news:3f3e2747 (AT) newsgroups (DOT) borland.com...
Quote:
I've a ListView with queued downloads. When i start transfer, the
downloading
thread updates some fields and a progess bar in the Listview.

When i start the thread i give it the ListItem->Index. During the
download,
if i insert another item in the Listview, it updates the wrong item.

Anyone as a good solution for this ?

Thanks in advance,

Hugo Oliveira Dias





Back to top
Hugo Oliveira Dias
Guest





PostPosted: Sat Aug 16, 2003 2:19 pm    Post subject: Re: TListView and Threads Reply with quote



I had already tried passing the pointer to the ListItem, but it didn't work.
I think it's because it's a virtual ListView.

Anyway i resolved the problem passing the pointer to the TList item used
for the Virtual ListView

Thanks for the tip.

Hugo Oliveira Dias


"Yahia El-Qasem" <Yahia.El-Qasem (AT) mgh (DOT) metro-ag.de> wrote

Quote:
I won't give it the index but a pointer to the ListItem... this way you
always have the right item for updating etc AFAIK...

I would think that you need to use Synchronize when updating the ListItem
from the thread...

Just some guesses...

Yahia

"Hugo Oliveira Dias" <hugo.dias (AT) no-spam (DOT) pluricanal.net> schrieb im
Newsbeitrag news:3f3e2747 (AT) newsgroups (DOT) borland.com...
I've a ListView with queued downloads. When i start transfer, the
downloading
thread updates some fields and a progess bar in the Listview.

When i start the thread i give it the ListItem->Index. During the
download,
if i insert another item in the Listview, it updates the wrong item.

Anyone as a good solution for this ?

Thanks in advance,

Hugo Oliveira Dias







Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sun Aug 17, 2003 7:04 am    Post subject: Re: TListView and Threads Reply with quote


"Hugo Oliveira Dias" <hugo.dias (AT) no-spam (DOT) pluricanal.net> wrote

Quote:
I had already tried passing the pointer to the ListItem, but
it didn't work. I think it's because it's a virtual ListView.

You should have said that earlier. Correct, a virtual listview will not
work for what you are asking for. TListItem pointers are not valid for a
virtual ListView, as all operations actually share a single physical
TListItem, meaning that all TListItem pointers you obtain will always point
to the same physical memory. You would have to pass a pointer to the actual
data item where the ListView gets its information from. Sounds like you
already discovered that.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.