is because it is updating too fast rather than the opposite. I think the
second).
"Gary" <Gary@discussions.microsoft.com> ha scritto nel messaggio
news:F0EB9705-E60A-4BE6-B328-7BDBCAC270B0@microsoft.com...
I tried using SetRedraw() but it doesn't seem to help much.
To give you an idea I am adding 8-10 items per second to the ListCtrl.
Any other alternative to reduce the flickering in addition to
LVS_EX_DOUBLEBUFFER which seem to help in reducing flickering a bit.
To try to speed things up you may consider another way for giving text
information to the listview in response to LVN_GETDISPINFO notification.
I read from another post here that you do a deep copy of the string in the
pszTex field (using some from of "strcpy", probably _tcscpy_s) when
processing LVN_GETDISPINFO.
I would suggest to try a faster technique, i.e. passing just the *address*
of the string (and not doing a deep-copy).
In fact, if you read the documentation of NMLVDISPINFO, you can note that
pszText can also contain just a pointer to the string (and this is cheaper
than doing a string copy, in this context of optimizations to avoid
flickering):
NMLVDISPINFO Structure
http://msdn.microsoft.com/en-us/library/bb774780.aspx
<quote>
[...]
You can either copy text to the buffer or assign the address of a string
to the pszText member. In the latter case, you must not change or delete
the string until the corresponding item text is deleted or two additional
LVN_GETDISPINFO messages have been sent.
</quote>
Giovanni