B
Bob Dankert
I have a component which inherits from the standard ListView control. Every
once in a while, this listview will not display any text in the control.
This happens randomly, in numerous programs, and without any explainable
reason. When this does happen, I can use debugger to view that the listview
does indeed contain a number of items. Also, I have a slight modification
to the listview to show a tool-tip with the text from the cell currently
below the mouse cursor. When the listview fails to draw the items, I still
get text from the tool-tip, so I know the items are there, they are just not
being drawn. When this happens, I have tried calling the following,
numerous times, in just about every order possible trying to get the
listview to draw and none of them have worked:
listview.refresh()
listview.update()
listview.clear() followed by re-populating
listview.invalidate()
listview.beginupdate() followed by listview.endupdate()
The only way to correct the issue is to close out of the program and re-open
the program, in which case it generally works. I have had a great deal of
difficulty diagnosing this as it only happens maybe once every hundred
times, if even this often. It has happened on numerous computers, so I
can't blame one particular computer as being the problem (though most of the
computers experiencing this problem run Windows XP). I do have some code in
my controls WndProc method, but I do not think any of this should be
affecting this. If needed, I can post this WndProc code (and I can't think
of any other code that would cause it not to paint).
I am looking for suggestions to fix this or if anyone has suggestions how to
debug this problem when it happens, please let me know. If there are any
tools that I can use to see what is causing the problem that do not require
the tool to be started before I run the executable, I would be excited to
know of them (the only tools I know of require the tool to be run before the
program is run.)
Thanks,
Bob Dankert
once in a while, this listview will not display any text in the control.
This happens randomly, in numerous programs, and without any explainable
reason. When this does happen, I can use debugger to view that the listview
does indeed contain a number of items. Also, I have a slight modification
to the listview to show a tool-tip with the text from the cell currently
below the mouse cursor. When the listview fails to draw the items, I still
get text from the tool-tip, so I know the items are there, they are just not
being drawn. When this happens, I have tried calling the following,
numerous times, in just about every order possible trying to get the
listview to draw and none of them have worked:
listview.refresh()
listview.update()
listview.clear() followed by re-populating
listview.invalidate()
listview.beginupdate() followed by listview.endupdate()
The only way to correct the issue is to close out of the program and re-open
the program, in which case it generally works. I have had a great deal of
difficulty diagnosing this as it only happens maybe once every hundred
times, if even this often. It has happened on numerous computers, so I
can't blame one particular computer as being the problem (though most of the
computers experiencing this problem run Windows XP). I do have some code in
my controls WndProc method, but I do not think any of this should be
affecting this. If needed, I can post this WndProc code (and I can't think
of any other code that would cause it not to paint).
I am looking for suggestions to fix this or if anyone has suggestions how to
debug this problem when it happens, please let me know. If there are any
tools that I can use to see what is causing the problem that do not require
the tool to be started before I run the executable, I would be excited to
know of them (the only tools I know of require the tool to be run before the
program is run.)
Thanks,
Bob Dankert