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. CListCtrl advanced - loading

CListCtrl advanced - loading

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
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.
  • J Offline
    J Offline
    JensB
    wrote on last edited by
    #1

    Hi Sometimes, i have a listview which has about 6000 records in it. It can take a while before showing the entire list. Does anyone know how to display a label message or a message 'List is loading .. Please wait' while the list is loading. When the list is shown, message should disappear. Anyone knows a good article about solving this problem. Best regards Jens

    N D N P 4 Replies Last reply
    0
    • J JensB

      Hi Sometimes, i have a listview which has about 6000 records in it. It can take a while before showing the entire list. Does anyone know how to display a label message or a message 'List is loading .. Please wait' while the list is loading. When the list is shown, message should disappear. Anyone knows a good article about solving this problem. Best regards Jens

      N Offline
      N Offline
      Neville Franks
      wrote on last edited by
      #2

      There is an article here on CP that displays a small progress bar while a tree is populated. That might be of use. However you would be better off either trying to improve the load time or using a load on demand technique with a virtual list box. I don't know where your 6000 records are coming from but one would like to think that loading them should be almost instantaneous. Users don't like to wait! Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com

      1 Reply Last reply
      0
      • J JensB

        Hi Sometimes, i have a listview which has about 6000 records in it. It can take a while before showing the entire list. Does anyone know how to display a label message or a message 'List is loading .. Please wait' while the list is loading. When the list is shown, message should disappear. Anyone knows a good article about solving this problem. Best regards Jens

        D Offline
        D Offline
        Dominik Reichl
        wrote on last edited by
        #3

        So you are looking for a status dialog or such? I am using Chris Maunders excellent status dialog: http://www.codeproject.com/miscctrl/progresswnd.asp[^] To update dialog controls while processing a big amount of data you should always call a function "Peek And Pump" which processes dialog messages (for example allows the user to click the cancel button of a dialog, without PeekAndPump all controls would be frozen and not reacting). With this dialog you also can show how many items you have processed already. If you don't need the progress bar, just hide it. Shouldn't be that hard. Btw, if you are processing such a large amount of data you should perhaps consider using a virtual list view which is MUCH faster than the normal Windows list view: http://www.codeguru.com/listview/VirtualListControl.html[^] :) -Dominik


        _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

        J 1 Reply Last reply
        0
        • D Dominik Reichl

          So you are looking for a status dialog or such? I am using Chris Maunders excellent status dialog: http://www.codeproject.com/miscctrl/progresswnd.asp[^] To update dialog controls while processing a big amount of data you should always call a function "Peek And Pump" which processes dialog messages (for example allows the user to click the cancel button of a dialog, without PeekAndPump all controls would be frozen and not reacting). With this dialog you also can show how many items you have processed already. If you don't need the progress bar, just hide it. Shouldn't be that hard. Btw, if you are processing such a large amount of data you should perhaps consider using a virtual list view which is MUCH faster than the normal Windows list view: http://www.codeguru.com/listview/VirtualListControl.html[^] :) -Dominik


          _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

          J Offline
          J Offline
          JensB
          wrote on last edited by
          #4

          yeah i'm currently looking at the 'virtual list view'. I hope i can use it too because i have about 6 columns & all text in the cells. I see the trick is to move all data in an array, and then when windows asks the text, just check which position (subitem) we are talking about & retrieve it from the array. But i think i need to read more of this to understand it better. :) Thanks for the good article. I'm sure it will be usefull. Greetings Jens

          1 Reply Last reply
          0
          • J JensB

            Hi Sometimes, i have a listview which has about 6000 records in it. It can take a while before showing the entire list. Does anyone know how to display a label message or a message 'List is loading .. Please wait' while the list is loading. When the list is shown, message should disappear. Anyone knows a good article about solving this problem. Best regards Jens

            N Offline
            N Offline
            Niklas L
            wrote on last edited by
            #5

            I assume you've already tried CListCtrl::SetItemCount() ?

            J 1 Reply Last reply
            0
            • N Niklas L

              I assume you've already tried CListCtrl::SetItemCount() ?

              J Offline
              J Offline
              JensB
              wrote on last edited by
              #6

              Well it's hard to know at beforehand. In my case there can be 5 customers at a little firm, but at another one there can be 60.000 or more customers. Greetings JensB

              1 Reply Last reply
              0
              • J JensB

                Hi Sometimes, i have a listview which has about 6000 records in it. It can take a while before showing the entire list. Does anyone know how to display a label message or a message 'List is loading .. Please wait' while the list is loading. When the list is shown, message should disappear. Anyone knows a good article about solving this problem. Best regards Jens

                P Offline
                P Offline
                Peter Mares
                wrote on last edited by
                #7

                Why don't you use a virtual listview? This basically means that you only need to load the records currently being displayed.... I don't know off hand of an article on CP for this, but there is documentation in the MSDN...


                www.kinkycode.com
                99 little bugs in the code, 99 little bugs, Fix 1 bug, recompile.... 101 little bugs in the code...

                J 1 Reply Last reply
                0
                • P Peter Mares

                  Why don't you use a virtual listview? This basically means that you only need to load the records currently being displayed.... I don't know off hand of an article on CP for this, but there is documentation in the MSDN...


                  www.kinkycode.com
                  99 little bugs in the code, 99 little bugs, Fix 1 bug, recompile.... 101 little bugs in the code...

                  J Offline
                  J Offline
                  JensB
                  wrote on last edited by
                  #8

                  yeah i'm making my own project now with integration of 'virtual listviews'. :) I've found some good articles on cp & codeguru that explain it pretty good :) I like the idea of only loading what is necessary. Will greatly reduce the wait-time. I'll let you know how much it went faster :) Greetings Jens

                  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