GetOpenFileName wont open huge list of files
I've been having problems with the File Dialog not opening a huge number of files from a directory. I have mapped the network drive to a single drive letter to shortne the path to just J:\ and still hav the same issue.
I always get the error in a message box (EQUCON_667962 is half of one of the filenames)
EQUCON_667962
File not found.
Please verify the correct filename was given.
I've included the directory listing of the files I'm trying to select.
I can stop this error occuring by removng the OFN_FILEMUSTEXIST Flag but the list of files returned by the GetOpenFileName function is still truncated. The same problems occur with the CFileDialog MFC version
BUF_SIZE is (1024 * 1024)
i.e. 1MB, I've tried 10MB and still get the same error.
Here's the code I'm using.
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(ofn));
ofn.Flags = OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_EXPLORER;
//ofn.hInstance = 0;
ofn.hwndOwner = this->m_hWnd;
ofn.lpstrDefExt = _T("cmp");
ofn.lpstrFile = new TCHAR[BUF_SIZE];
ofn.lpstrFilter = _T("CMP Files (*.cmp)|*.cmp|All Files (*.*)|*.*|");
ofn.lStructSize = sizeof(ofn);
ofn.nMaxFile = BUF_SIZE;
memset(ofn.lpstrFile, 0, BUF_SIZE);
if(GetOpenFileName(&ofn))
{
TCHAR szBuffer[MAX_PATH];
_sntprintf(szBuffer, MAX_PATH, _T("GetOpenFilename Failed <%d>"), CommDlgExtendedError());
AfxMessageBox(szBuffer);
}
delete[] ofn.lpstrFile;
BTW I'm using Windows 2000 SP3,
CommDlg.DLL version 3.10.0.103

