Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. listctrl with large number of items

listctrl with large number of items

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pranavamhari
    wrote on last edited by
    #1

    hi, please help me get over this problem. I have a listctrl and it needs to display about 15000 items. But after displaying it, when i close the dialog, it takes a while to close the dialog. Can see the app running when i hit ctrl+alt+del. When i decrease the count , the dialog closes instantly. How can i close the dialog instantly ? The problem is more evident if i launch this dialog from another dialog, in that case the parent dialog is not redrawn until the child dialog closes completely. BTW, I dont want to use the virtual list. Hari Krishnan

    M A A 3 Replies Last reply
    0
    • P pranavamhari

      hi, please help me get over this problem. I have a listctrl and it needs to display about 15000 items. But after displaying it, when i close the dialog, it takes a while to close the dialog. Can see the app running when i hit ctrl+alt+del. When i decrease the count , the dialog closes instantly. How can i close the dialog instantly ? The problem is more evident if i launch this dialog from another dialog, in that case the parent dialog is not redrawn until the child dialog closes completely. BTW, I dont want to use the virtual list. Hari Krishnan

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      One option would be to review your UI, having a list with 15000 items is useless and not really user friendly. Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ?


      Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

      D P 2 Replies Last reply
      0
      • P pranavamhari

        hi, please help me get over this problem. I have a listctrl and it needs to display about 15000 items. But after displaying it, when i close the dialog, it takes a while to close the dialog. Can see the app running when i hit ctrl+alt+del. When i decrease the count , the dialog closes instantly. How can i close the dialog instantly ? The problem is more evident if i launch this dialog from another dialog, in that case the parent dialog is not redrawn until the child dialog closes completely. BTW, I dont want to use the virtual list. Hari Krishnan

        A Offline
        A Offline
        Alexander M
        wrote on last edited by
        #3

        use the owner-data option to make freeing memory faster Don't try it, just do it! ;-)

        1 Reply Last reply
        0
        • M Maximilien

          One option would be to review your UI, having a list with 15000 items is useless and not really user friendly. Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ?


          Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Maximilien wrote: Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ? Actually, a virtual list control is one that keeps only a small subset of the data items in memory at any one time. The rest of the data, while not being displayed, is kept in a data structure of some sort. The control uses the LVS_OWNERDATA style.

          P 1 Reply Last reply
          0
          • M Maximilien

            One option would be to review your UI, having a list with 15000 items is useless and not really user friendly. Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ?


            Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

            P Offline
            P Offline
            pranavamhari
            wrote on last edited by
            #5

            hi, thanks for ur reply. But i forgot to mention , the listctrl lists files searched from the disk, and i was only making sure it displays a very large number of entries. As you can see, i can't review the interface, as i should expect any large number. BTW, after posting here, i tried the ownerdraw style, but the check boxes are not shown. The check box space is empty. Hari Krishnan

            1 Reply Last reply
            0
            • D David Crow

              Maximilien wrote: Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ? Actually, a virtual list control is one that keeps only a small subset of the data items in memory at any one time. The rest of the data, while not being displayed, is kept in a data structure of some sort. The control uses the LVS_OWNERDATA style.

              P Offline
              P Offline
              pranavamhari
              wrote on last edited by
              #6

              hi, i tried this owner data option, but the check boxes are not shown. The space is empty. Hari Krishnan

              D 1 Reply Last reply
              0
              • P pranavamhari

                hi, please help me get over this problem. I have a listctrl and it needs to display about 15000 items. But after displaying it, when i close the dialog, it takes a while to close the dialog. Can see the app running when i hit ctrl+alt+del. When i decrease the count , the dialog closes instantly. How can i close the dialog instantly ? The problem is more evident if i launch this dialog from another dialog, in that case the parent dialog is not redrawn until the child dialog closes completely. BTW, I dont want to use the virtual list. Hari Krishnan

                A Offline
                A Offline
                Abin
                wrote on last edited by
                #7

                Then try this: Override whichever function in your application which will be called before your main window(or frame) closes, for example, "OnCancel()" or "OnOK()" for a dialog based app, etc, then add just one single line of code into the very beginning of tha function body: void CMyDlg::OnCancel() // or whatever in your project { m_wndList.LockWindowUpdate(); // m_list is the CListCtrl contains 15000 items // the rest of original code... } This should shorten your waiting time by at least 1/2.

                1 Reply Last reply
                0
                • P pranavamhari

                  hi, i tried this owner data option, but the check boxes are not shown. The space is empty. Hari Krishnan

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  In the context for which I mentioned the LVS_OWNERDATA style, it had nothing to do with checkboxes. Have you looked at the CCheckListBox class, or a list control with checkbox capability?

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups