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. CListCtrl SetItemState(...) timing

CListCtrl SetItemState(...) timing

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++questionannouncement
3 Posts 3 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.
  • D Offline
    D Offline
    Doc Lobster
    wrote on last edited by
    #1

    Hi, this one is for the MFC aces: I got a rather complicated CListCtrl (owner draw and owner data) with a 100 entries, though I don't think that should matter for this issue. Calling SetItemState(...) takes me about 30 ms on my rather new PC (maybe half the time in release mode), when it has to alter an item state. When the item state stays the same, it returns instantly. Calling SetItemState(-1, ...) takes about the same time as any other SetItemState(...) call, even if it alters all items. It doesn't really make a difference if the ListCtrl is SW_SHOW or SW_HIDDEN and setting ListCtrl.SetRedraw(false) doesn't help either. When just a couple of items are changed at the same time, I get a noticeable break. Has anybody experienced something similar or knows a work-around? (I'm just asking before starting to write test cases) Thanks in advance, Andy

    N C 2 Replies Last reply
    0
    • D Doc Lobster

      Hi, this one is for the MFC aces: I got a rather complicated CListCtrl (owner draw and owner data) with a 100 entries, though I don't think that should matter for this issue. Calling SetItemState(...) takes me about 30 ms on my rather new PC (maybe half the time in release mode), when it has to alter an item state. When the item state stays the same, it returns instantly. Calling SetItemState(-1, ...) takes about the same time as any other SetItemState(...) call, even if it alters all items. It doesn't really make a difference if the ListCtrl is SW_SHOW or SW_HIDDEN and setting ListCtrl.SetRedraw(false) doesn't help either. When just a couple of items are changed at the same time, I get a noticeable break. Has anybody experienced something similar or knows a work-around? (I'm just asking before starting to write test cases) Thanks in advance, Andy

      N Offline
      N Offline
      Nathan Holt at EMOM
      wrote on last edited by
      #2

      Doc Lobster wrote:

      I got a rather complicated CListCtrl (owner draw and owner data) with a 100 entries, though I don't think that should matter for this issue. Calling SetItemState(...) takes me about 30 ms on my rather new PC (maybe half the time in release mode), when it has to alter an item state. When the item state stays the same, it returns instantly.

      It sounds like the list control is sending messages to announce the state change before it returns. I'm not sure there is any way to disable that. Nathan

      1 Reply Last reply
      0
      • D Doc Lobster

        Hi, this one is for the MFC aces: I got a rather complicated CListCtrl (owner draw and owner data) with a 100 entries, though I don't think that should matter for this issue. Calling SetItemState(...) takes me about 30 ms on my rather new PC (maybe half the time in release mode), when it has to alter an item state. When the item state stays the same, it returns instantly. Calling SetItemState(-1, ...) takes about the same time as any other SetItemState(...) call, even if it alters all items. It doesn't really make a difference if the ListCtrl is SW_SHOW or SW_HIDDEN and setting ListCtrl.SetRedraw(false) doesn't help either. When just a couple of items are changed at the same time, I get a noticeable break. Has anybody experienced something similar or knows a work-around? (I'm just asking before starting to write test cases) Thanks in advance, Andy

        C Offline
        C Offline
        CPallini
        wrote on last edited by
        #3

        Doc Lobster wrote:

        Calling SetItemState(-1, ...) takes about the same time as any other SetItemState(...) call, even if it alters all items.

        I think this is a good hint. (Un)fortunately 'debugging' is your only friend. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

        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