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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

common dialog error in VFP 8 when too many files selected

Status
Not open for further replies.

kprogrammer

Programmer
Feb 28, 2003
27
0
0
I am working in VFP 8 and using the common dialog to select files. The control works fine until the number of files, in conjunction with the size of their names increases. When this happens, the control returns no files in the selection array. I believe I am exceeding the controls allocated memory for the selected file array.

Has anyone overcome this problem?

Can anyone point me to an alternative control for browsing directories and selecting large numbers of files before I write my own process?

Kirk
 
This is the code I used to set up the common dialog (cusCommonDialog). It works great untill the list of files gets long. Thats when the entire list gets dropped! The returned array is empty and the associated filecount property is 0.

Kirk
 
The number of files selected is between 100 and 150, and I know it is not exceeding the VFP array limits.

I'm looking at adapting the treeview control for my app now. I'm not sure if it will work since I need to get the data on the selected files out of it. I'm need to find a solution.

Thanks,

Kirk
 

Kirk,

I need to get the data on the selected files out of it.

If you think a Treeview is the best solution, don't forget that it has a property for showing checkboxes on each node. That might be a good way for the user to make the selection. Or, perhaps you can let drag the files out of the treeview and drop them somewhere to indicate a selection.

However, I think you should try to solve the problem with the Common Dialog before you switch to a different approach. The Common Dialog has the advantage of being a Windows standard, and supports things like History and My Documents.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
I would like to fix the problem in the common dialog, but I suspect it is a problem with the memory being allocated for the array to store the list of selected files. There just isn't enough of it, and when it is exceeded the entire selected list is dropped. I don't know how I can fix this.

Kirk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top