// append the "*.*" all files filter
CString allFilter;
VERIFY(allFilter.LoadString(AFX_IDS_ALLFILTER));
strFilter += allFilter;
strFilter += (TCHAR)'\0'; // next string please
#ifndef _MAC
strFilter += _T("*.*");
#else
strFilter += _T("****");
#endif
strFilter += (TCHAR)'\0'; // last string
dlgFile.m_ofn.nMaxCustFilter++;
dlgFile.m_ofn.lpstrFilter = strFilter;
#ifndef _MAC
dlgFile.m_ofn.lpstrTitle = title;
#else
dlgFile.m_ofn.lpstrPrompt = title;
#endif
// --- Begin modifications ---
// - use a big buffer for the file names
// (note that pre-SP2 versions of NT 4.0 will nevertheless
// truncate the result)
CString strFileNames;
dlgFile.m_ofn.lpstrFile = strFileNames.GetBuffer(2048);
dlgFile.m_ofn.nMaxFile = 2048;
// - copy the file names to a string list
POSITION pos = dlgFile.GetStartPosition();
while (pos)
{
fileNames.AddTail(dlgFile.GetNextPathName(pos));
}
return TRUE;
// --- End modifications ---
}