[python-win32] large buffer with GetOpenFileNameW

Andrew Ziem ahz001 at gmail.com
Tue May 22 23:25:48 EDT 2018


When I select a few files, the dialog works, but when I select many
files, I get the following error. Do you have any advice?

error: (12291, 'GetOpenFileNameW', 'No error message is available')


Error 12291 is FNERR_BUFFERTOOSMALL


The full code is below

import win32con
import win32gui
ret = win32gui.GetOpenFileNameW(None,
                                Flags=win32con.OFN_ALLOWMULTISELECT
                                | win32con.OFN_EXPLORER
                                | win32con.OFN_FILEMUSTEXIST
                                | win32con.OFN_HIDEREADONLY)

Andrew


More information about the python-win32 mailing list