Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

common dialog control multiple file open. . .

Status
Not open for further replies.

ultimatewilliam

Programmer
Oct 16, 2002
57
SG
It looks like my common dialog could not handle at least more than 15 files. When i inspect the .filename property of the common dialog control, it has this value: "c:\Temp\À”ü¿$…" If i select only few files, 3 or 10, no problem. I kept trying but i really got no idea why this happen. . . thank you for your time.
 
Try changing the MaxFileSize value. The default is 260 but limits the number of file names to about 14.

CommonDialog1.MaxFileSize = 5000

I think the MaxFileSize is the total number of characters in the selected file names.
 
Which version of VB are you using? Which service pack?

With VB6 SP5 the MaxFileSize property only applies to the buffer size for all file names returned from the dialog. Unless an individual file name is longer than 255 characters or if you are using multiselect then the default should be fine.

With MaxFileSize at default I can still see all the contents of System32, which has over 2000 files!


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
With VB6 SP5 and the highest the MaxFileSize can go is 26000.

' Set up file filter for the Open Dialog box
strdat = "Excel Files (*.xls)|*.xls|"
strAll = "All Files (*.*)|*.*|"
With cdlCommon
.FileName = vbNullString
.MaxFileSize = 26000
.Flags = cdlOFNHideReadOnly Or cdlOFNExplorer Or cdlOFNAllowMultiselect
.Filter = strAll & strdat
.ShowOpen
End With

Swi
 
glad to have good guys like you, thanks for all the support and info. good day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top