in reply to Using Win32::FileOp::OpenDialog to get multiple files

It appears that the behavior of the dialog is suffering from buffering.

This is what I found on CPAN at Win32::fileOp.

"There is a little problem with the underlying function. You have to preallocate a buffer for the selected filenames and if the buffer is too small you will not get any results. I've consulted this with the guys on Perl-Win32-Users and there is not any nice solution. The default size of buffer is 256B if the options do not include OFN_ALLOWMULTISELECT and 64KB if they do. You may change the later via variable $Win32::FileOp::BufferSize."

Set your buffering to 128KB before you attempt to use the dialog. Step up your buffer size until you get the results you are seeking.

Slow down and read the guidance offered on the CPAN.

Good luck!

UPDATE: BrowserUk set the filter '*', which forced an allocation for the filter buffer (and eased the suffering from buffering). This approach forces the OS to handle the buffer allocation; However, you may want to modify the filter to '*.xls', '*.*' or some other value as a literal. No sense in wasting resources on file types you don't need.

  • Comment on Re: Using Win32::FileOp::OpenDialog to get multiple files