Make file dialog support FNERR_BUFFERTOSMALL if buffer too small.

This commit is contained in:
Wolfgang Schwotzer 2004-05-03 20:09:09 +00:00 committed by Alexandre Julliard
parent a2423c0d97
commit 2f0a4ac46d
1 changed files with 8 additions and 4 deletions

View File

@ -34,9 +34,6 @@
*
* FIXME: lpstrCustomFilter not handled
*
* FIXME: if the size of lpstrFile (nMaxFile) is too small the first
* two bytes of lpstrFile should contain the needed size
*
* FIXME: algorithm for selecting the initial directory is too simple
*
* FIXME: add to recent docs
@ -1989,9 +1986,16 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
}
else
{
/* FIXME set error FNERR_BUFFERTOSMALL */
WORD size;
size = strlenW(lpstrPathAndFile) + 1;
if (fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT)
size += 1;
/* return needed size in first two bytes of lpstrFile */
*(WORD *)fodInfos->ofnInfos->lpstrFile = size;
FILEDLG95_Clean(hwnd);
ret = EndDialog(hwnd, FALSE);
COMDLG32_SetCommDlgExtendedError(FNERR_BUFFERTOOSMALL);
}
goto ret;
}