Help with win32ui.CreateFileDialog

Dr. Thomas Hübner dr.t.huebner at gmx.de
Thu Jul 18 09:27:25 EDT 2002


Hi,

I am running into a problem with win32ui.CreateFileDialog during the
selection of multiple files. I am successful in selecting files only up
to a certain number. The number depends on the length of the path, e.g. 
selecting files from "E:\Dokumente und Einstellungen\thomas\Eigene
Dateien\GP\kunden\tracker\" works up to 7 file, doing the same for
"E:\temp" doesn't break until 10+ files.

Here is the code I use:

def test():
    import win32ui, win32con
    dlg = win32ui.CreateFileDialog(1,
                                   None,
                                   None, 
                                   (win32con.OFN_FILEMUSTEXIST|
                                    win32con.OFN_EXPLORER|
                                    win32con.OFN_ALLOWMULTISELECT),
                                   'all (*.log)|*.log||')

    dlg.SetOFNTitle('Image to Print')
    testvalue = dlg.DoModal()
    if testvalue == win32con.IDOK:
        print "did get IDOK", testvalue
        print dlg.GetPathNames()
    else:
        print "did not get IDOK", testvalue
        print dlg.GetPathNames()
           
def main():  
# Get Logfile
	test()

if __name__ == "__main__":
    main()

Example output, that I get up to 7 files:

>>> import Script2
>>> Script2.main()
did get IDOK 1
['E:\\Dokumente und Einstellungen\\thomas\\Eigene
Dateien\\GP\\kunden\\tracker\\Kopie (4) von unix.log', ...
a.s.o.

and the one that I get from 8 files upwards:
>>> Script2.main()
did not get IDOK 2
['-\x01']
>>> 

Any ideas to get past the limit? By the way I am using Python 2.1 and
About PythonWin calls itself win32all build 145

Txs for your help

Thomas

--
Thomas Hübner
dr.t.huebner at gmx.de



More information about the Python-list mailing list