Indigo Rose Software
Indigo Rose Software
Log in to the Customer Portal Customer Login
Software Development Discussion Forums Forums
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    113

    Problem with Dialog.FileBrowse

    I'm trying to simply add the choosen (by the Dialog.FileBrowse) file path to a label:

    Code:
    my_file = Dialog.FileBrowse(true, "Choose a file, program, document or bookmark", Working_drive..":\\", "All files (*.*)|*.*|", "", "", false, true);
    
    if my_file[1] ~= "CANCEL" and my_file ~= "nil" then
    Label.SetText("Label1", my_file[1]);
    
    end
    If the choosen file is a .exe, or .doc or any other extension this works fine, but if the user chooses a .lnk (example "my_program.lnk") the label gets "C:\program files\my_program.exe" instead of "my_program.lnk" that is the result I expect and that I need.
    The same problem happens if the user chooses a .url (favorite link), the result string is "C:\temp\temporary internet files\Content.IE5\X4RBTE0\www.website[1])"

    Is there anything wrong with the code or there is a workaround for this?

    Many thanks for your kind attention.

  2. #2
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    113

    Solved!

    The problem depends from the *.* filter in the Dialog.FileBrowse.

    Infact, if i use

    Dialog.FileBrowse(true, "Choose a file, program, document or bookmark", Working_drive..":\\", "All files (*.*)|*.???|", "", "", false, true);

    it works, and the Label gets the correct shortcut .lnk or .url path.

    DOS always helps!

    Better, use *.?* so you can parse files with any extension length.
    Last edited by Cybergraph; 07-29-2010 at 10:28 AM.

  3. #3
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,347
    Also, when you use the folder and file browse functions, (as far as I know) you need to specify "\\" at the end of the search path.
    Action Plugins
    AllOn | Box | Class | Cursor | DXML | Error | Frames | GlobalPaths | Goto | Group | INIPlus | KeyLock | MathEx | Menu | Project | Resize | StatusBar
    Download

  4. #4
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    113
    Dear Centauri Soldier

    Infact, the searcing path is Working_drive..":\\"

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Indigo Rose Software