2500 item in list control
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: 2500 item in list control

  1. #1
    Join Date
    Feb 2007
    Posts
    258

    2500 item in list control

    Hi all,

    I have made a dialog based application in vc2008, in that application i have created a list control. In that list control i am displaying file names from a particular folder......

    suppose folder contains 2500 files and allfiles are bmp type, i am also displaying system icon(which is picked up from system at runtime only) in front of every file.

    Now the problem is as soon as i click on adding file to my list control only border of my list ctrl is displyed and everything becomes white and after some time not responding status is being shown and after some time application crashes. i have monitored its memory usage from task manager it exceeds very fast and its very high...

    i am not getting how to resolve it and infact what exactly the problem is...

    can anybody help me in this....

  2. #2
    Join Date
    Oct 2002
    Location
    Austria
    Posts
    1,284

    Re: 2500 item in list control

    Youre possibly running into the limit of GDI Handles. There are only some 10000 available and an icon uses 4 as far as I remember.
    Check with taskmanager.
    Kurt

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,205

    Re: 2500 item in list control

    The debugger would be a good place to start.

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,051

    Re: 2500 item in list control

    suppose folder contains 2500 files ...
    Yeah, and this exactly is a situation when virtual list enters the scene... This is crazy to stuff all 2500 items in the poor control.
    Best regards,
    Igor

  5. #5
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: 2500 item in list control

    Quote Originally Posted by VCProgrammer View Post
    Hi all,

    I have made a dialog based application in vc2008, in that application i have created a list control. In that list control i am displaying file names from a particular folder......

    suppose folder contains 2500 files and allfiles are bmp type, i am also displaying system icon(which is picked up from system at runtime only) in front of every file.

    Now the problem is as soon as i click on adding file to my list control only border of my list ctrl is displyed and everything becomes white and after some time not responding status is being shown and after some time application crashes. i have monitored its memory usage from task manager it exceeds very fast and its very high...

    i am not getting how to resolve it and infact what exactly the problem is...

    can anybody help me in this....
    As Igor said, a virtual list should probably fix this.
    http://msdn.microsoft.com/en-us/library/ye4z8x58.aspx
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center