Announcement

Collapse
No announcement yet.

UNC in OpenFile Dialog

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

  • UNC in OpenFile Dialog

    Does anyone know how to return a filepath is UNC format (not mapped drive letters) from an OpenFile Dialog or similiar.

    Thanks

    Jim

  • #2
    I think GetOpenFileName will work with:

    \\ComputerName\ShareName\folder\file

    I know once you have a file name in that format, PB 'OPEN' works just fine.

    Using GetOpenFilename you may have to not include OFN_FILEMUSTEXIST flag in OPENFILENAME and check it yourself when selected in a hook procedure ( Demo: Explorer-Style hook Procedures for OpenFileDialog and SaveFileDialog 3-31-07) but I think it will work just fine as is.

    If that doesn't work, try using ShBrowseForFolder, and include style BIF_BROWSEINCLUDEFILES and don't include BIF_DONTGOBELOWDOMAIN.

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

    Comment


    • #3
      Are you looking for it to be converted from drive letter to unc or are you just curious if the file open dialog will open UNC's automatically?

      Example: X:\Somefolder\myData.xls
      Would convert to: \\Server\Share\Somefolder\myData.xls


      The open dialog works fine with UNC's so no issue there.

      If you are looking to convert X:\ to \\Server\Share then use WNetGetConnection to resolve it.
      <b>George W. Bleck</b>
      <img src='http://www.blecktech.com/myemail.gif'>

      Comment


      • #4
        Thanks George. That looks like what I was looking for.

        Jim

        Comment

        Working...
        X