I have set up the filter corectly but I cannot see a way of entering more than one file extension in the 3rd argument. Is there any way to set the default file extension to be the same as what the user selected from the filter?
You did not set any default file extension in the 2nd parameter. If you i.e. create your dialog the followed way with "BMP" as default extension
CString str;
static char szFilter[]=...
CFileDialog dlg( FALSE, _T("BMP"), NULL, OFN_OVERWRITEPROMPT | OFN_EXTENSIONDIFFERENT, szFilter, this);
if( dlg.DoModal() == IDOK )
{
str=dlg.GetFileName();
str=dlg.GetPathName();
}
than a call of GetPathName would return the inserted name with path and active extension. If you change the extension in the dropown filter list than the extension is also changed in the filename and path.