15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CFileDialog Problem /w OFN_ALLOWMULTISELECT

Jens Bohlmann -- bohly@ki.comcity.de
Tuesday, February 18, 1997

Environment: Visual C++ 4.2b, NT 4.0

Hello,

I have cderiveda Multi-Select FileDialog from CFileDialog with an
enhanced Buffer size - not much complicated:

...
CMultiFileDlg::CMultiFileDlg(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
		DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
		CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
  m_ofn.lpstrFile = m_strFileName.GetBuffer(4096);
  m_ofn.nMaxFile = 4096;
  m_ofn.Flags |= OFN_ALLOWMULTISELECT;
}

and used it with:

  ...
  CMultiFileDlg dlg ( TRUE,    // Open
                   NULL,    // No default extension
                   NULL,    // No initial file name
                   OFN_FILEMUSTEXIST | OFN_HIDEREADONLY ,
                   "Bitmap files (*.bmp)|*.bmp|All files (*.*)|*.*||");
  if (dlg.DoModal() == IDOK) 
  {
   ...

When I open less than e.g. 12 files with that Box everything is o.k.
When I select more ( i would say 50 files ) the DoModal() function
doesn't come back. Instead a Dialogbox with "<...> File not found Pleas
verify the correct filename was given." appears with a cutted part of
an filename in <...>. This box araises in

int CFileDialog::DoModal()
{		
  ...
  nResult = ::GetOpenFileName(&m_ofn);    <<< does NOT come back with an error
  ...
}


Thanks

Jens



David Lowndes -- David.Lowndes@bj.co.uk
Wednesday, February 19, 1997

>I have cderiveda Multi-Select FileDialog from CFileDialog with an
enhanced Buffer size - not much complicated:

When I open less than e.g. 12 files with that Box everything is o.k.
When I select more ( i would say 50 files ) the DoModal() function
doesn't come back.
<

Jens,

Try NT4 SP2 (and the hot-fixes). SP2 appears to fix a similar related
problem with the Explorer style open dialog box (though it's never
been documented as a problem as far as I know).

>Dave




Become an MFC-L member | Вернуться в корень Архива |