views:

20

answers:

1

Hi,

Does anyone know of a good MFC example of how to create and use a virtual list control with a database that has 100K records? I don't want to load in all the records at once because it takes too much time. I want all updates to the list control to be fast based on user interaction.

Thanks, Mike

A: 

Something like http://www.codeguru.com/cpp/controls/listview/advanced/article.php/c4151 .

It's simple, really: make sure you set the LVS_OWNERDATA flag when creating the control (or set it in the resource editor), handle the messages that are described in MSDN under "About list-view controls", start with handling LVN_GETDISPINFO. That's mostly it, unless you want to draw the entries yourself, then you're in owner-draw territory. But start with LVS_OWNDERDRAW and LVN_GETDISPINFO.

Roel
Thank you for the information. I will give it a try.
Mike S