 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Hugo Oliveira Dias Guest
|
Posted: Sat Aug 16, 2003 12:46 pm Post subject: TListView and Threads |
|
|
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
|
Posted: Sat Aug 16, 2003 1:06 pm Post subject: Re: TListView and Threads |
|
|
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
|
Posted: Sat Aug 16, 2003 2:19 pm Post subject: Re: TListView and Threads |
|
|
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
|
Posted: Sun Aug 17, 2003 7:04 am Post subject: Re: TListView and Threads |
|
|
"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 |
|
 |
|
|
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
|
|