Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

Having what is probably a simple problem (application focus vs shell)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

    -David

  • #2
    Rather than shelling, have you tried using the API Counterpart to DIR$()? Probably would be a lot less headaches...
    Adam Drake
    Drake Software

    Comment


    • #3
      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.

      Comment


      • #4
        In source code forum are a number of solutions.
        Roy Cline

        Comment


        • #5
          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

          Comment


          • #6
            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.
            Adam Drake
            Drake Software

            Comment


            • #7
              David, i just posted a PwrDev-VarClass example on my board to enumerate folders..
              hellobasic

              Comment


              • #8
                > 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.
                Michael Mattias
                Tal Systems Inc. (retired)
                Racine WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  Best guess? You are modifying the directory you are searching between calls to DIR$ (add or delete a file, probably a delete)

                  MCM
                  Michael Mattias
                  Tal Systems Inc. (retired)
                  Racine WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #10
                    Michael-

                    You might be right about the modifications between initiating the dir$. Will take a look.

                    Thanks for the direction.

                    -David

                    Comment


                    • #11
                      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.
                      Roy Cline

                      Comment

                      Working...
                      X