Announcement

Collapse
No announcement yet.

Updating a listview

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Updating a listview

    I have a voice response telephony application which uses a main thread, running the applications GUI, and 60 threads for the individual phone lines.
    This runs fine, but all threads must give their status to the main listview, so one can see what callers are doing at that moment.
    (Which texts are played, and what choices are made)
    First I used SendMessage from the threads, but that was a heavy load due to all the context switches this causes. (There can be 20 or 30 updates a second)
    Now I created a global FIFO buffer where the threads dump their updates, and the main thread puts them into the listview.
    This works, but I was wondering if there is a more 'elegant' way to do this...
    Regards,
    Peter

    "Simplicity is a prerequisite for reliability"

  • #2
    Did you try PostMessage instead SendMessage?
    Regards,
    RValois.
    http://www.rvalois.com.br/downloads/free/

    Comment


    • #3
      You could queue the updates. Search 'queue' in subject in source code forum.

      However, this is pretty much what PostMessage() does, although if you have the thread ID handy PostThreadMessage() might be worth a try, too.
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment

      Working...
      X