Bug when filling a CListBox with a list of non archived files?
-
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?
-
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?
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
-
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?
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 /?
. UsingFindFirstFile()
/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
-
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 /?
. UsingFindFirstFile()
/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
-
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.
-
I'm on Windows 7 Home Premium, it looks like this has been around for some time.
It's time for a new signature.
-
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.
-
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.
-
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?
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