Link to home
Start Free TrialLog in
Avatar of RogerMadore
RogerMadore

asked on

TOpenDialog file woes.....

I've been using TOpenDialog for selecting multiple files. Although the selected files are stored in the TString property "Files", I can't seem to access all the lines of this object. It will contain the first 17 files and a truncated copy of the 18th line. Is this a known bug? Is there are patch or a workaround?
Avatar of ronit051397
ronit051397

Can you show some code?
Avatar of RogerMadore

ASKER

  If OpenDialog.Files.Count>0 Then
      Begin
      For X := 0 To OpenDialog.Files.Count-1 Do
         Begin
         If FileExists(OpenDialog.Files[X]) Then
            Begin
            mtrLoadFiles(OpenDialog.Files[X]);
            Memo.Lines.Add(OpenDialog.Files[X]+' added.');
            End;
         End;

ASKER CERTIFIED SOLUTION
Avatar of ronit051397
ronit051397

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the answer, but unfortunately it doesn't work. If you look at the source of Dialog.Pas, you'll see a buffer being used. I tried changing this buffer size and creating my own component, but it still didn't work.... perhaps I overlooked something. Thanks for any other input.
function TOpenDialog.DoExecute(Func: Pointer): Bool;
const
  MultiSelectBufferSize = 8192;
  ...
begin
   ...
    if ofAllowMultiSelect in FOptions then
      nMaxFile := MultiSelectBufferSize else
      nMaxFile := MAX_PATH;
   ...
I have 36 selected 36 files and it worked fine. What version of Delphi do you have?
I am going to rest in the carribeans, so you better reject my answer and let others to answer.

Bye
Ronit
I have Delphi 3 Client/Server (Build 5.53)