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. hints on using a clistview with a really large dataset

hints on using a clistview with a really large dataset

Scheduled Pinned Locked Moved C / C++ / MFC
performancec++databasetutorialquestion
5 Posts 3 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.
  • M Offline
    M Offline
    mickelliot
    wrote on last edited by
    #1

    Hi there, I'm trying to implement a clistview (MFC) which has a really large dataset attached to it. By really large I mean around 4000 columns and 4000 rows. Each cell in the list contains just a single character. I'm having trouble with scrolling around the list, scrolling is very slow and ugly as the screen updates. I've tried using the CMemDC files that are available and that helped a bit, but not much. You can still see a kind of shuddering as the screen fills itself. The data is not stored in a database. It is loaded into memory from a text file. Basically the text file contains 4000 strings of 4000 characters in length. Each string is split up into individual characters and they are loaded into the Clist view at runtime. If anybody has any hints on how to speed up scrolling around a large list, I'd be really grateful! perhaps I should be using a class other than CListView?? mick

    V S 2 Replies Last reply
    0
    • M mickelliot

      Hi there, I'm trying to implement a clistview (MFC) which has a really large dataset attached to it. By really large I mean around 4000 columns and 4000 rows. Each cell in the list contains just a single character. I'm having trouble with scrolling around the list, scrolling is very slow and ugly as the screen updates. I've tried using the CMemDC files that are available and that helped a bit, but not much. You can still see a kind of shuddering as the screen fills itself. The data is not stored in a database. It is loaded into memory from a text file. Basically the text file contains 4000 strings of 4000 characters in length. Each string is split up into individual characters and they are loaded into the Clist view at runtime. If anybody has any hints on how to speed up scrolling around a large list, I'd be really grateful! perhaps I should be using a class other than CListView?? mick

      V Offline
      V Offline
      vladfein
      wrote on last edited by
      #2

      Why do you need a separate column for each character? It will go much faster if you had 4000 characters in one column. ----------------------------- Get trial copy of comment generating tool CommentMakerPro, std::string and std::string containers viewer FeinEvaluatorPro and windows manager for Microsoft Visual Studio .NET FeinWindows at www.FeinSoftware.com

      M 1 Reply Last reply
      0
      • V vladfein

        Why do you need a separate column for each character? It will go much faster if you had 4000 characters in one column. ----------------------------- Get trial copy of comment generating tool CommentMakerPro, std::string and std::string containers viewer FeinEvaluatorPro and windows manager for Microsoft Visual Studio .NET FeinWindows at www.FeinSoftware.com

        M Offline
        M Offline
        mickelliot
        wrote on last edited by
        #3

        Hi vladfein, The application I'm working on is for molecular biologists. Each character represents a single "letter" in a DNA sequence. Each character has to be colored a different color depending on what letter it is, has to be selectable with a mouse, etc. If there's a way to do this with a string that would be great, but the only way I could think of was to pDC->TextOut each individual character one at a time, changing the color between each character... this turned out to be considerably slower than the cviewlist option. Mick

        V 1 Reply Last reply
        0
        • M mickelliot

          Hi vladfein, The application I'm working on is for molecular biologists. Each character represents a single "letter" in a DNA sequence. Each character has to be colored a different color depending on what letter it is, has to be selectable with a mouse, etc. If there's a way to do this with a string that would be great, but the only way I could think of was to pDC->TextOut each individual character one at a time, changing the color between each character... this turned out to be considerably slower than the cviewlist option. Mick

          V Offline
          V Offline
          vladfein
          wrote on last edited by
          #4

          Actually, I am sure you can display 4000 x 4000 table of characters in a custom CScrollView-derived view faster than CListCtrl with 4000 columns would. The trick is to only paint what you have to. ----------------------------- Get trial copy of comment generating tool CommentMakerPro, std::string and std::string containers viewer FeinEvaluatorPro and windows manager for Microsoft Visual Studio .NET FeinWindows at www.FeinSoftware.com

          1 Reply Last reply
          0
          • M mickelliot

            Hi there, I'm trying to implement a clistview (MFC) which has a really large dataset attached to it. By really large I mean around 4000 columns and 4000 rows. Each cell in the list contains just a single character. I'm having trouble with scrolling around the list, scrolling is very slow and ugly as the screen updates. I've tried using the CMemDC files that are available and that helped a bit, but not much. You can still see a kind of shuddering as the screen fills itself. The data is not stored in a database. It is loaded into memory from a text file. Basically the text file contains 4000 strings of 4000 characters in length. Each string is split up into individual characters and they are loaded into the Clist view at runtime. If anybody has any hints on how to speed up scrolling around a large list, I'd be really grateful! perhaps I should be using a class other than CListView?? mick

            S Offline
            S Offline
            ssiegel
            wrote on last edited by
            #5

            Use a virtual list control. Rather than loading all the rows when the list is created you just load the columns assoicated with the rows that are displayed. You recieve "scrolling" messages, (both up and down), that tell you when additional row data is required. Just look up "virtual list control" in your MSDN documentation. Or check out some of these articles. Code Guru article[^] MSDN Article[^] Other Article[^] Sam

            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