Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Alternative to GetFile() that allows multiselect?
Versions des environnements
Network:
Windows 2008 Server
Hi all,
Is there an alternative to GetFile() where the user can multi-select a bunc h of files? In some old code I used comdlg32.ocx - and it is working (on the same PC no less) but cannot get the code to work on the new machine.
First - if you have an alternative, that would be great.
Secondly, if you don't, anyone have a clue why this code is failing me when placed into a new project?
I get the error "class definition OLECOMMONDIALOGS is not found". I thought it was supposed to be in ComDlg32.ocx - maybe I am even wrong on this?
>>>>>>>>>>>>>>>>>>>>>>>>
WITH THISFORM
* if no .ioGetFilesDialog property yet, need to create one; I tried to do this via defining a form property
* .ioGetFilesDialog and then using CREATEOBJECT() to fill it with an object but this does not work with OLE controls
* - they have to be dropped on the form during design time or added via .AddObject() at run time
IF NOT PEMSTATUS(THISFORM,"ioGetFilesDialog",5)
.NewObject("ioGetFilesDialog","oleCommonDialogs")
ENDIF
WITH .ioGetFilesDialog
* override the dialog title
STORE "Select files to to process" TO .DialogTitle
* set the default directory to the current directory
STORE SYS(5) + CURDIR() TO .InitDir
* fire the getfiles dialog
.GetFiles()
* if user picked any files, process them; if no files, just return as we will not alert them if they choose Cancel
IF .inFileCount = 0
RETURN
ENDIF
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement