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. Bug when filling a CListBox with a list of non archived files?

Bug when filling a CListBox with a list of non archived files?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestiondatabasealgorithmstutorial
11 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.
  • E Erik

    Hello, as most of you know, you can fill a Listbox with a complete directory list by Sending a message LB_DIR. This works fine, for example I create a CListBox Control like this, and fill the contents with a directory list: CListBox m_List1; ... m_List.SendMessage(LB_DIR,DDL_READWRITE ,(long)(const char*)(CString("C:\\temp\\*.*").GetBuffer(0))); (Alternatively, you can use m_List.Dir(DDL_READWRITE, "C:\\temp\\*.*"); which leads to exactly the same result) The problem I have is the following: if a file in my directory has not set any of the following bits: - "File is ready for archiving" - "For fast searching, allow Indexing service to index this file" it won't appear in my list. In order to do this, use Windows explorer, right-click on a file, select properties, look at Attributes and click the button "Advanced", and remove the upper two checkboxes. No matter what attributes I set, when these two checkboxes are not set, the file will not be listed. Can you please try to reproduce this? I think this is a severe bug that Microsoft should fix, or am I doing something completely wrong? How can I overcome this behaviour? Is there any known fix to this issue?

    C Offline
    C Offline
    Cool_Dev
    wrote on last edited by
    #2

    m_list.Dir(DDL_READWRITE, "C:\\temp\\*.*"); tried and works fine for me.. :^)

    1 Reply Last reply
    0
    • E Erik

      Hello, as most of you know, you can fill a Listbox with a complete directory list by Sending a message LB_DIR. This works fine, for example I create a CListBox Control like this, and fill the contents with a directory list: CListBox m_List1; ... m_List.SendMessage(LB_DIR,DDL_READWRITE ,(long)(const char*)(CString("C:\\temp\\*.*").GetBuffer(0))); (Alternatively, you can use m_List.Dir(DDL_READWRITE, "C:\\temp\\*.*"); which leads to exactly the same result) The problem I have is the following: if a file in my directory has not set any of the following bits: - "File is ready for archiving" - "For fast searching, allow Indexing service to index this file" it won't appear in my list. In order to do this, use Windows explorer, right-click on a file, select properties, look at Attributes and click the button "Advanced", and remove the upper two checkboxes. No matter what attributes I set, when these two checkboxes are not set, the file will not be listed. Can you please try to reproduce this? I think this is a severe bug that Microsoft should fix, or am I doing something completely wrong? How can I overcome this behaviour? Is there any known fix to this issue?

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #3

      Works the same way here too, if none of those attributtes are set then the files do not appear in the listbox, don't know what causes this and how you can fix it (aside of forgetting about it and writing your own code to fill the list using FindFirstFile[^], FindNextFile[^] and FindClose[^] or somesuch)

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

      modified on Wednesday, July 21, 2010 5:36 AM

      1 Reply Last reply
      0
      • E Erik

        Hello, as most of you know, you can fill a Listbox with a complete directory list by Sending a message LB_DIR. This works fine, for example I create a CListBox Control like this, and fill the contents with a directory list: CListBox m_List1; ... m_List.SendMessage(LB_DIR,DDL_READWRITE ,(long)(const char*)(CString("C:\\temp\\*.*").GetBuffer(0))); (Alternatively, you can use m_List.Dir(DDL_READWRITE, "C:\\temp\\*.*"); which leads to exactly the same result) The problem I have is the following: if a file in my directory has not set any of the following bits: - "File is ready for archiving" - "For fast searching, allow Indexing service to index this file" it won't appear in my list. In order to do this, use Windows explorer, right-click on a file, select properties, look at Attributes and click the button "Advanced", and remove the upper two checkboxes. No matter what attributes I set, when these two checkboxes are not set, the file will not be listed. Can you please try to reproduce this? I think this is a severe bug that Microsoft should fix, or am I doing something completely wrong? How can I overcome this behaviour? Is there any known fix to this issue?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #4

        I have run some tests on this and it appears that the removal of the "For fast searching, allow Indexing service to index this file" bit is the problem. If this bit is set then the file appears in my list, even if the Archive bit is not set. This may have something to do with the way the bit is interpreted as a 'not' option, as described by dir /?. Using FindFirstFile() / FindNextFile() I get all the files, including the one with indexing not set (attribute 0x2000), so it definitely looks like a Microsoft bug.

        It's time for a new signature.

        modified on Wednesday, July 21, 2010 7:52 AM

        E 1 Reply Last reply
        0
        • L Lost User

          I have run some tests on this and it appears that the removal of the "For fast searching, allow Indexing service to index this file" bit is the problem. If this bit is set then the file appears in my list, even if the Archive bit is not set. This may have something to do with the way the bit is interpreted as a 'not' option, as described by dir /?. Using FindFirstFile() / FindNextFile() I get all the files, including the one with indexing not set (attribute 0x2000), so it definitely looks like a Microsoft bug.

          It's time for a new signature.

          modified on Wednesday, July 21, 2010 7:52 AM

          E Offline
          E Offline
          Erik
          wrote on last edited by
          #5

          Thanks alot, as for the other two persons who were not able to reproduce this behaviour: which OS do you use? I have only XP Pro for testing, and I can reproduce it on every XP machine available in my office.

          L 2 Replies Last reply
          0
          • E Erik

            Thanks alot, as for the other two persons who were not able to reproduce this behaviour: which OS do you use? I have only XP Pro for testing, and I can reproduce it on every XP machine available in my office.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #6

            I'm on Windows 7 Home Premium, it looks like this has been around for some time.

            It's time for a new signature.

            E 1 Reply Last reply
            0
            • L Lost User

              I'm on Windows 7 Home Premium, it looks like this has been around for some time.

              It's time for a new signature.

              E Offline
              E Offline
              Erik
              wrote on last edited by
              #7

              Thanks, so it's obviously not fixed in Win7, does anybody know how to report this directly to Microsoft? Any chance they will do anything to fix this?

              D 1 Reply Last reply
              0
              • E Erik

                Thanks alot, as for the other two persons who were not able to reproduce this behaviour: which OS do you use? I have only XP Pro for testing, and I can reproduce it on every XP machine available in my office.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #8

                I have posted a report on this to the Microsoft forum, so will let you know if I get any feedback.

                It's time for a new signature.

                E 1 Reply Last reply
                0
                • L Lost User

                  I have posted a report on this to the Microsoft forum, so will let you know if I get any feedback.

                  It's time for a new signature.

                  E Offline
                  E Offline
                  Erik
                  wrote on last edited by
                  #9

                  Thanks alot, do you have a link for me, so that I can follow the discussion there?

                  L 1 Reply Last reply
                  0
                  • E Erik

                    Thanks, so it's obviously not fixed in Win7, does anybody know how to report this directly to Microsoft? Any chance they will do anything to fix this?

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

                    Erik wrote:

                    Any chance they will do anything to fix this?

                    I'm 99% sure they won't. First, it's been around for a long time so there's a chance that some applications rely upon it. Second, no data is being lost so it would be very low priority. Third, there is a workaround.

                    "One man's wage rise is another man's price increase." - Harold Wilson

                    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                    "Man who follows car will be exhausted." - Confucius

                    1 Reply Last reply
                    0
                    • E Erik

                      Thanks alot, do you have a link for me, so that I can follow the discussion there?

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #11

                      This[^] is my post so with luck any responses will appear below.

                      It's time for a new signature.

                      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