browseForFolder return values

Discussion in 'AutoCAD' started by Jason Piercey, Dec 22, 2004.

  1. Using the code Tony posted here:
    http://tinyurl.com/55q9k

    or here if you prefer the longer link
    http://groups-beta.google.com/group/autodesk.autocad.customization/msg/b7d8dcd2de543f57

    If you select "My Computer" you get a return value of
    something similar to the following

    "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"

    Is there some benefit to allowing this type of return value?
    I mean, what can one programmatically do with such a
    value or does it not contain any "special hidden secrets"?

    I was thinking about modifying it just a little to include
    something like this to ensure that a path is returned.

    (wcmatch <return value> "@`:\\*")

    Thoughts/opinions?
     
    Jason Piercey, Dec 22, 2004
    #1
  2. The third argument to the BrowseForFolder method of the file system
    object, is supposed to allow options that prevent the user from selecting
    items that do not represent folders, but on my system (XP SP2) I have
    not been able to get them to work.

    The BROWSEINFO structure documentation in MSDN enumerates the
    flags that you can pass, but the don't appear to work from Visual
    LISP, and I don't know why.
     
    Tony Tanzillo, Dec 22, 2004
    #2
  3. Jason Piercey, Dec 22, 2004
    #3
  4. Trying to get a handle on how some of this stuff works.

    Are you saying that items like these

    BIF_BROWSEFORCOMPUTER
    BIF_BROWSEFORPRINTER

    fail to work from activeX entirely, or just with the XP SP2?

    If these do work, they are passed as quoted symbols or
    do the evaluate to an integer value? I'm not finding the
    answer to that while searching through MSDN.
     
    Jason Piercey, Dec 23, 2004
    #4
  5. Hi Jason,

    not an answer but an alternative... there is the browseforfolder and opensave common dialogs at the downloads section of www.drafteam.com including the visual lisp code.
     
    Luis Esquivel, Dec 23, 2004
    #5
  6. If these do work, they are passed as quoted symbols or
    They are Bit values.

    ; ulFlags - value of iOptns
    ;
    ; 1 RestrictToFilesystem = &H1 ' BIF_RETURNONLYFSDIRS
    ; 2 RestrictToDomain = &H2 ' BIF_DONTGOBELOWDOMAIN
    ; 8 RestrictToSubfolders = &H8 ' BIF_RETURNFSANCESTORS
    ; 16 ShowTextBox = &H10 ' BIF_EDITBOX
    ; 32 ValidateSelection = &H20 ' BIF_VALIDATE
    ; 64 NewDialogStyle = &H40 ' BIF_NEWDIALOGSTYLE
    ; 4096 BrowseForComputer = &H1000 ' BIF_BROWSEFORCOMPUTER
    ; 8192 BrowseForPrinter = &H2000 ' BIF_BROWSEFORPRINTER
    ; 16384 BrowseForEverything = &H4000 ' BIF_BROWSEINCLUDEFILES
    ;
    ;
    ; Flags specifying the options for the dialog box. This member can include
    ; zero or a combination of the following values.
    ;
    ; BIF_BROWSEFORCOMPUTER
    ; Only return computers. If the user selects anything other than a computer,
    ; the OK button is grayed.
    <clip>


    In this sample I use iOptns = 48 > 16 + 32

    ; Example: (ALE_BrowseForFolder "Select a folder:" 48 "C:\\Temp\\")
    ;
    ; Credits: Tony Tanzillo
    ;
    (defun ALE_BrowseForFolder (PrmStr iOptns DefFld /
    ShlObj Folder FldObj OutVal)
    (vl-load-com)
    (setq
    ShlObj (vla-getInterfaceObject
    (vlax-get-acad-object) "Shell.Application"
    )
    Folder (vlax-invoke-method ShlObj
    'BrowseForFolder 0 PrmStr iOptns DefFld
    )
    )
    (vlax-release-object ShlObj)
    (if Folder
    (progn
    (setq
    FldObj (vlax-get-property Folder 'Self)
    OutVal (vlax-get-property FldObj 'Path)
    )
    (vlax-release-object Folder)
    (vlax-release-object FldObj)
    OutVal
    )
    )
    )

    --

    Marc'Antonio Alessi
    http://xoomer.virgilio.it/alessi
    (strcat "NOT a " (substr (ver) 8 4) " guru.")

    --
     
    Marc'Antonio Alessi, Dec 23, 2004
    #6
  7. I figured they were bit values, but could see very
    little difference between some of them when viewing
    the different dialogs trying it bit by bit.

    Thanks.
     
    Jason Piercey, Dec 23, 2004
    #7
  8. Thanks Luis, I'll check them out when I
    have more than a minute.

    --
    Autodesk Discussion Group Facilitator



    opensave common dialogs at the downloads section of www.drafteam.com
    including the visual lisp code.
     
    Jason Piercey, Dec 23, 2004
    #8
  9. PS:

    negative values also make changes to the dialog.

    --
    Autodesk Discussion Group Facilitator



    <snip>
     
    Jason Piercey, Dec 23, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.