Article ID: 820631 - Last Review: November 26, 2007 - Revision: 2.6 You receive a "Too many files selected" error message when you use the OpenFileDialog controlOn This PageSYMPTOMSYou may have a Windows Form with an OpenFileDialog control, and the Multiselect property of the control is set to True. When you run your
application, and you try to open more than 200 files, you may receive the
following error message: An unhandled exception
of type 'System.InvalidOperationException' occurred in
system.windows.forms.dll Additional information: Too many files selected. Please select fewer files and try again. CAUSEThis problem occurs because the application uses the Open
File common dialog box with the OFN_ALLOWMULTISELECT flag set. The buffer that
is passed to the Open File common dialog box in the OPENFILENAME.lpstrFile
field is too small. Therefore, the GetOpenFileName function
returns an error value, and you
receive the error message when you try to open more than 200
files. STATUS This
behavior is by design. MORE INFORMATIONSteps to Reproduce the Problem
REFERENCESFor more information about the OpenFileDialog class, visit the following Microsoft Web site: http://msdn2.microsoft.com/en-us/library/system.windows.forms.openfiledialog(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/system.windows.forms.openfiledialog(vs.71).aspx) For additional information, click the following article number to view the article in the Microsoft Knowledge Base: 131462
(http://support.microsoft.com/kb/131462/EN-US/
)
HOWTO: Handle FNERR_BUFFERTOOSMALL in Windows
APPLIES TO
| Article Translations
|
Back to the top
