DDXFile v1.1
For developers who use MFC this is a freeware DDX routine which subclasses an edit control to allow you to easily specify a file. When the edit control is correctly setup it will look like:
The button beside the edit control sports a tooltip when the button is over it and when the button is hit, the following dialog is displayed:
The caption of the dialog can be customized through the DDX routine. Another flag allows the developer to customize the dialog so that it uses the older style common dialog which looks like:
Features |
History |
Usage |
API Reference |
Contacting the Author |
To use ddxfile in your project simply include ddxfile.cpp and the 6 string resources from the test application in your application. Then #include ddxfile.h in which ever of your modules requires it and make the appropriate calls. Included is a simple dialog based application which shows how to use it. Basically all you need to do is add to your DoDataExchange function as follows:
v1.1 (17th September 1998)
The following functions are provided:
DDX_FilenameControl
DDX_FilenameValue
DDV_FilenameControl
void DDX_FilenameControl(CDataExchange* pDX, int nIDC, CGetFilenameControl& rCGetFilenameControl, DWORD dwFlags, const CString& sDialogTitle, const CString& sExtFilter);
Parameters
pDX is the usual CDataExchange object which will be passed into your DoDataExchange function.
nIDC is the dialog ID of the edit control to subclass.
rCGetFilenameControl will contain upon return the window control which manages the compound edit and button controls.
dwFlags is a combination of the bit values to customize the display of the dialog. See ddxfile.h for all the allowable values.
sDialogTitle is the caption to use for the filename picker dialog.
Remarks
Associates an existing edit control with dialog ID nIDC to a compound filename picker control. Normally you would calls to this function in your dialog class's DoDataExchange member function.
void DDX_FilenameControl(CDataExchange* pDX, CGetF
ilenameControl& rCGetFilenameControl, CString& sFile);Parameters
pDX is the usual CDataExchange object which will be passed into your DoDataExchange function.
rCGetFilenameControl is the folder control to get or set the filename for.
sFile is the actual file to get or set into the control depending on the direction of data exchange occuring .
void DDV_FilenameControl(CDataExchange* pDX, CGetFilenameControl& rCGetFilenameControl, DWORD dwFlags);
Parameters
pDX is the usual CDataExchange object which will be passed into your DoDataExchange function.
rCGetFilename
Control is the filename control to get or set the filename for.dwFlags
is the flags to customize the bahaviour of the control. The available flags are:GF_OVERWRITEPROMPT | The user will be prompted about overwriting existing file prior to allowing selection |
GF_FILEMUSTEXIST | File must exist to be selected |
GF_OLD_STYLE_DIALOG | Use the old style file open dialog instead of the style as used in Windows Explorer |
PJ Naughter
Email: pjn@indigo.ie
Web: http://indigo.ie/~pjn
17th September 1998