hehe, lemme have a hack at making it easier then. Find attached cjDialogs.dll. It's a normal COM dll so use regsvr32 to register it. Exposed interfaces at this time are OpenFile and SaveFile, I'll add Picture, Font, Colour and Printer dialogs later (I do have real work I am supposed to be doing right now \:\) )

Properties of both interfaces:
Filename - the filename of the file being selected
Filter - filters in the usual pipe separated format
FilterIndex - the filters are a one indexed array, this is the default
InitialDir - the folder the dialog starts in
Title - the caption of the dialog form

OpenFile has an additional property
MustExist - boolean, when true you have to select a file that already exists

SaveFile has an additional property
OverwritePrompt - boolean, when true will prompt 'are you sure' when selecting an existing filename

Both interfaces have this method:
Execute - boolean, if true then Filename will be set

examples of use
 Code:
break on
dim $oDialog
$oDialog = CreateObject('cjDialogs.SaveFile')
$oDialog.Filter='Text Files|*.txt|All Files|*.*'
$oDialog.FilterIndex=2
$oDialog.InitialDir='c:\'
$oDialog.Title='Save my text file'
;$oDialog.MustExist=false
$oDialog.OverwritePrompt=true

if $oDialog.Execute 
	"filename: " $oDialog.Filename
else
	"pressed cancel"
endif
?


You can change the SaveFile to OpenFile and move the ; to the next line down and it's the File Open dialog example.

This was written in Delphi 5 in about an hour, half of which was me learning how to create an ActiveX dll from scratch \:D

cj


Attachments
cjDialogs.zip (286 downloads)
Description: An ActiveX/COM dll to provide File Open and File Save dialogs