hi,

anything that updates the gui must be done from the main thread.
syncronize will ensure this. critical sections will only ensure that
you have exclusive access to the resource, which is not enough in this
case.

other approaches to the issue are:
1) post windows messages to the listview. this can be done from any
thread. i usually avoid this approach (not particularly object
oriented)
2) have the thread place data into a threadsafe list/queue, which the
main thread polls and updates the listbox every second or so. i usually
go for this approach, as it means the gui only changes once per second,
not constantly in a state of change.

hope that helps,
ben.

--- Robert Martin <[EMAIL PROTECTED]> wrote:
> If I have component A (a listview) that my main VCL thread writes to
> and
> various other threads write to using Synchronize() is this safe or do
> I need
> Critical Sections around all the code that adds to the listview.


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.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"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to