Announcement

Collapse
No announcement yet.

OpenFileDialog

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

  • OpenFileDialog

    I'm trying to keep the filename and directory structure separate on my openfile dialog, this is the ofn.flags piece....

    I can't seem to find an equate to tell it ot return JUST the filename so I can bring the directory back from the function separately...

    I had this working last year, decided it was great having them separate, but because I have to do a file copy into a new directory I want to keep them separate....

    Suggestions? Can't imagine we need a code sample for this, see the commdlg32.inc for the openfiledialog.


    Scott

    -------------
    Scott
    mailto:[email protected][email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

  • #2
    Hello,

    What I do that keeps it easy is pass the entire path and file name to DIR$, you already know id exists, but what you want is the return from DIR$: Just the file name. This is also a easy way to convert short 8.3 names to long names. DIR$ when passed a short name and path will return just the long name.

    Colin Schmidt,

    ------------------
    Colin Schmidt & James Duffy, Praxis Enterprises, Canada

    Comment


    • #3
      That works beautifully!!

      Thanks!

      ------------------
      Scott
      mailto:[email protected][email protected]</A>
      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment


      • #4
        I do this... Seems to work well.

        FileName$ = PARSE$(FilePath$, "\", PARSECOUNT(FilePath$, "\"))

        Anyone see any problems with this? Dir sounds like a good way too...


        Scott

        Scott Wolfington
        [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

        Comment


        • #5
          While at it...
          Code:
          FileSpec$ = Parse$(FileSpec$,"\",-1)
          or why not
          FilePart$ = Parse$(FileSpec$,"\",-1)
          DirPart$  = Remove$(FileSpec$,FilePart$)
          But this is shortcuts and not very accurate.
          You will find them come up short at times....
          Have a look at Path...-functions in Shlwapi.dll
          ------------------
          Fred
          mailto:[email protected][email protected]</A>
          http://www.oxenby.se



          [This message has been edited by Fred Oxenby (edited March 15, 2000).]
          Fred
          mailto:[email protected][email protected]</A>
          http://www.oxenby.se

          Comment

          Working...
          X