Assuming your code looks something like this:
CFileDialog dialog(...); dialog.DoModal();
Determine the maximum number of files that you want to support, for example:
#define MAX_FILE_NAMES 256
Add this before calling DoModal :
CString data; dialog.m_pOFN->nMaxFile = (MAX_FILE_NAMES*(MAX_PATH+1))+1; dialog.m_pOFN->lpstrFile = data.GetBuffer((MAX_FILE_NAMES*(MAX_PATH+1))+1);
Add this after calling DoModal :
data.ReleaseBuffer();
source share