I do know what the "right" solution is, however, search
for notify on file change or waitonsinglebjectchange or some
correct form of these two key words for possible insight into
a solution to the problem.
I would suggest that your program as it starts can get
the correct information and then use some form of
windows notification to know if there are changes, etc.
My suggest relates to what I think is a program design
problem not a problem with DIR$. However, I understand
the limitations to advise or suggestions given to a problem
which a careful a search of these forums coupled with
an understand of the object of the "code" is not always
apparent to someone who does not understand the
situation being asked about, such as me.
Announcement
Collapse
No announcement yet.
Having what is probably a simple problem (application focus vs shell)
Collapse
X
-
Michael-
You might be right about the modifications between initiating the dir$. Will take a look.
Thanks for the direction.
-David
Leave a comment:
-
Best guess? You are modifying the directory you are searching between calls to DIR$ (add or delete a file, probably a delete)
MCM
Leave a comment:
-
> bugs using the DIR$ function (does not always return all the files).
Crapola. Show failing code. We'll tell you how to fix your bug.
Leave a comment:
-
David, i just posted a PwrDev-VarClass example on my board to enumerate folders..
Leave a comment:
-
David - I actually wasn't suggesting using DIR$() at all - I was suggesting using the API Counterpart - have you tried it? I have yet to encounter a time when it doesn't return all files, including hidden ones.
Leave a comment:
-
Roy-
Thanks the reply. Not sure which problem you are referring. The DIR$ problem or lost focus in SHELL problem. If you don't mind, could you provide the link the solution you view as the right one.
Your help appreciated.
-David
Leave a comment:
-
would loved to have use the DIR$ (had been using this historically), the problem is periodically it does not return all the files in the directory. there a number of entries on the PB forums also showing this problem and the shell as the only solution.
Leave a comment:
-
Rather than shelling, have you tried using the API Counterpart to DIR$()? Probably would be a lot less headaches...
Leave a comment:
-
Having what is probably a simple problem (application focus vs shell)
I have a small GUI application which is basically a text box to display status messsages and a progress bar to provide visually of where the application is.
Part of the program is using
Shell Environ$("COMSPEC")+" /C "+FOUTFILE, 6
which I am using to capture an accurate directory because of bugs using the DIR$ function (does not always return all the files).
After the above shell statement (which is doing what it is supposed to do), the textbox and progress bars no longer update, even though the rest of the program works through to completion doing what it should be doing.
All thoughts or direction appreciated.
Regards.
-DavidTags: None
Leave a comment: