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