Multiselect on CFileDialog (VC5)

I can only select 13 files, if more than this number the GetPathName or GetNextPathName will return a string "||", what's wrong with this ?
ahTriAsked:
Who is Participating?
 
V_BapatCommented:
Hi ahTri
This is because CFileDialog set the buffer which stores the file names(lpstrFile member of OPENFILENAME struct) to 260 chars.

To verify this call ::CommDlgExtendedError function and you will get the error : FNERR_BUFFERTOOSMALL

You can derive a class from CFileDialog and set the buffer size to what you want.

Download the sample application from this site:
http://support.microsoft.com/download/support/mslfiles/OfnKing.EXE 

The buffer size is defined by the member variable m_szBigBuffer in CustomFileDialog.h

Try it out.

Vicky
0
 
ahTriAuthor Commented:
look like 13 file-names overload the buffer or something.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.