Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Flickering list control

Flickering list control

Scheduled Pinned Locked Moved C / C++ / MFC
performancequestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andrew Stampor
    wrote on last edited by
    #1

    I am updating a list control with several operations, including deleting some entries and adding others. Due to the speed at which the new entries must be made, I have found that I need to do a SetDraw(FALSE) prior to adding and removing the entries to ensure that all of the time critical messages that are the basis of the entries are entered and none are missed. Although I am now catching all of the messages, I now find that the list control constantly flickers irritatingly. Is there a way to prevent this flickering? Any ideas are appreciated. Thanks.:)

    T 1 Reply Last reply
    0
    • A Andrew Stampor

      I am updating a list control with several operations, including deleting some entries and adding others. Due to the speed at which the new entries must be made, I have found that I need to do a SetDraw(FALSE) prior to adding and removing the entries to ensure that all of the time critical messages that are the basis of the entries are entered and none are missed. Although I am now catching all of the messages, I now find that the list control constantly flickers irritatingly. Is there a way to prevent this flickering? Any ideas are appreciated. Thanks.:)

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      What messages are you catching? What does it have in common with blocking the redraws of list control? Tomasz Sowinski -- http://www.shooltz.com

      A 1 Reply Last reply
      0
      • T Tomasz Sowinski

        What messages are you catching? What does it have in common with blocking the redraws of list control? Tomasz Sowinski -- http://www.shooltz.com

        A Offline
        A Offline
        Andrew Stampor
        wrote on last edited by
        #3

        The messages are from a queue that is being populated by a program that is external to my application. Essentially, the program is on a network and maintains its own queue of the messages that are being sent on the network. When a message is processed, it is removed from the queue. My application taps into the queue and dumps each entry one-by-one into the list control. Since my app maintains a max size for the list control, when an entry is added to the list control, if it is at the max size, it will first delete the oldest entry and then add the new entry. The reason for the SetRedraw was that the list control was being redrawn both after the delete and the add. The messages in the other application are so quick that my app was missing messages because of this extra redraw. Now, I no longer miss the messages, but the screen flickers. Any ideas?:confused:

        T 1 Reply Last reply
        0
        • A Andrew Stampor

          The messages are from a queue that is being populated by a program that is external to my application. Essentially, the program is on a network and maintains its own queue of the messages that are being sent on the network. When a message is processed, it is removed from the queue. My application taps into the queue and dumps each entry one-by-one into the list control. Since my app maintains a max size for the list control, when an entry is added to the list control, if it is at the max size, it will first delete the oldest entry and then add the new entry. The reason for the SetRedraw was that the list control was being redrawn both after the delete and the add. The messages in the other application are so quick that my app was missing messages because of this extra redraw. Now, I no longer miss the messages, but the screen flickers. Any ideas?:confused:

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          Maybe you should switch into virtual list mode (LVS_OWNERDATA style) - you'd keep the strings in your own data structures and list would notify you that it needs repainting. You could even move message retrieval/storing into separate thread. Tomasz Sowinski -- http://www.shooltz.com

          A 1 Reply Last reply
          0
          • T Tomasz Sowinski

            Maybe you should switch into virtual list mode (LVS_OWNERDATA style) - you'd keep the strings in your own data structures and list would notify you that it needs repainting. You could even move message retrieval/storing into separate thread. Tomasz Sowinski -- http://www.shooltz.com

            A Offline
            A Offline
            Andrew Stampor
            wrote on last edited by
            #5

            I currently have the message retrieval in a separate thread. I have reservations about changing the structures being used; the application currently works and has gone through the testing process and a structural change would mean more retesting time than is allotted for the project. If you know of any other way, I would really appreciate it. I was kinda hoping that you would tell me about the little known "StopFlickering()" method.;) Thanks a lot.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups