[python-win32] CreateFileDialog insufficient buffer size

Nils Smeds smeds@pdc.kth.se
Sun, 12 Jan 2003 21:21:30 +0000


Hi,

I have run into the same problem as described in
http://mail.python.org/pipermail/python-list/2002-July/113933.html
by Thomas H=FCbner (originally) and Richie Hindle
(who diagnosed it).

I am curious if it is on anyone's todo-list to work around
this problem where the DoModal() fails as the file names
selected in the dialog box are so many that the internal
buffer in MFC is insufficient to hold them all. (This
I expect is only likely to happen when
win32con.OFN_ALLOWMULTISELECT has been stated among the flags
to CreateFileDialog.)

The only thing I've been able to so far is to conclude that
DoModal() returns the value 2 when the buffer is insufficient
so at least it is possible to detect in the application. But
it would be great if the win32ui automatically reallocated
the buffer to the right size as described in
http://support.microsoft.com/directory/article.asp?ID=3DKB;EN-US;Q131462

On a side issue:

Is it possible to use the CreateFileDialog to get a Folder selected
by the user. That is, can I pass a filter value into CreateFileDialog()
so that the user is only able to specify his/her folder of interest
and not a particular file?

Many thanks in advance,

/Nils=20