1 Million ListView List

I have a SysListView32 that should contain millions of rows and three columns of text A, B, C each <256 characters.

Say, column B has many repetitions (example: column A is the name of the file, column B is the path, and each row is the file system file) and has only 100k different values โ€‹โ€‹(instead of several millions).

Is it possible to avoid duplication in RAM of the contents of column B of the ListView GUI element?

Is it possible to populate a ListView only pointers to array elements (taken from the 100k-element array of different values โ€‹โ€‹of column B) instead of duplicated data?

How to change this to make it work?

 LV_ITEM item; item.mask = LVIF_TEXT; item.pszText = "Hello"; ... ListView_SetItem(hList, &item); 
+5
source share
1 answer

What you need is also called a Virtual List. A virtual list control is a list control that has the LVS_OWNERDATA style. This style allows the control to support element counting to DWORD (the default value of the element is int only). However, the biggest advantage of this style is the ability to have only a subset of data elements in memory at any given time. This allows the virtual list list control to impersonate use with large databases of information where specific data access methods already exist. For a given data set (list or dynamic array) you need to perform the following steps:

  • Add LVS_OWNERDATA Style to ListView
  • Make a call to CListCtrl :: SetItemCount, passing in the size of the data source, for example std :: vector :: size ().
  • Catch the LVN_GETDISPINFO notification. Here the data is displayed in ListCtrl.

Please see the attached links that I added for more information and sample code. If you use CListView, you can access CListCtrl using GetListCtrl .

References:

Virtual List Controls

Using virtual lists

0
source

Source: https://habr.com/ru/post/1269271/


All Articles