Common Dialog multiple file Selection

KeeperRUKeeperRU Member Posts: 58
I'm trying to modify cu412, OpenFile() - functions.
To add Multi File Selection support.

According to that:
http://msdn.microsoft.com/en-us/library ... 42(v=vs.60).aspx

I need:
cdlOFNAllowMultiselect OR cdlOFNExplorer OR cdlOFNLongNames

So I add just this code:
CommonDialogControl.Flags := 2621952;

And that's work fine, but
CommonDialogControl.FileName
Return only Folderpath, without Filenames. What is wrong?

Comments

  • kinekine Member Posts: 12,562
    I think it is because if multi file is used, the list of filenames is returned in another way than when single file mode. It must be list or another property, thus you need to do more changes than just set the flag.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • KeeperRUKeeperRU Member Posts: 58
    kine wrote:
    I think it is because if multi file is used, the list of filenames is returned in another way than when single file mode. It must be list or another property, thus you need to do more changes than just set the flag.

    According to API and examples in the internet - there is only one command to return filenames.

    Format like this: c:\TEST\filename1.txt filename2.txt filename3.txt
    Between FileNames special Char: Chr(0) or something else;

    But in debugger I see only: c:\TEST\
    That strange... however I am looking for same trouble in the internet and some people too - can't receive Filenames, only FilePath.
    http://social.msdn.microsoft.com/Forums ... rum=isvvba

    OR this:
    http://social.msdn.microsoft.com/Forums ... vblanguage
  • KeeperRUKeeperRU Member Posts: 58
    I just get something...

    51115df688002f76bb06f36a5ab9a89a.png

    Problem right here: "111231co.csv" "111231cd.csv"

    When first characteg is: " - functions return NOTHING (only Filepath).

    But If you correct text to this (manually): 111231co.csv" "111231cd.csv"
    All work just fine. Maybe it's Win7 problem or something? What the problem with first " ? :-k
  • KeeperRUKeeperRU Member Posts: 58
    How text variables stored in memory?
    According to Debugger: Text := "";
    So If we get: Text := "С:\TEMP\ "111231co.csv" "111231cd.csv "";

    Then Navision think that me have:
    Text := "С:\TEMP\ "

    Because of "".
    How I can avoid that? :?

    Somebody told me that after С:\TEMP\ is /0 symbol (null-teminated line?)
    And maybe NAV can't properly work with it?
  • kinekine Member Posts: 12,562
    If the strings are null separated, than yes, you cannot see the rest, because NAV uses the null as end of the string...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.