- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi
I have one question.
Namely, I write application which uses function/procedure GETOPENFILENAME. Under structure type Flags I put"ofn_explorer .or. ofn_allowmultiselect" which means that I want Explorer-style dialog box and multiple selections of files.
But when I want to read or get information about selected files and directory in string structure type lpstrFile, I get only directory without files. How can I get full path and all files which I selected? When I exclude ofn_explorer flag (old style dialog box) everything is OK, but I want new style dialog box.
Thank You.
Kreso.
링크가 복사됨
2 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Rehi Kreso,
The information is (supposed to be) there, but it's a bit hidden. In case of multi-select dialog box, the directory name is followed by char(0), followed by char(0)-separated list of file names, terminated by double char(0). Thus, you have to parse the string to retrieve the list of file names:
Code:
!Assuming "szFiles" is the string to parse (OFN%lpstrFile) nBegin=1 !Index of 1st character in next filename nFiles=0 !Number of files retrieved DO nNextZero = nBegin + INDEX(szFiles(nBegin:), CHAR(0))-1 IF (nNextZero-nBegin .LE. 1) EXIT !Terminal double zero IF (nBegin.EQ.1) THEN !Directory name sDir = szFiles(nBegin:nNextZero-1) ELSE !File names nFiles = nFiles+1 sFile = szFiles(nBegin:nNextZero-1) !Do something with sFile (or, better, TRIM(sDir)//""//sFile) END IF nBegin = nNextZero + 1 END DO
Jugoslav
