On Tue, 29 Aug 2006 23:10:37 +0200
bobby <[EMAIL PROTECTED]> wrote:

> I have problems using SelectDirectoryDialog on Win32.
> When expanding node, and one of the sub-nodes (subfolder) have a lot
> of files (say 10.000), the node will need too much time to expand.
> It is not the matter of LCL, but a generic 'Browse for folder'
> problem on Windows.
> 
> Because of all that, I'm trying to make my own form for selecting
> folder (something like a custom SelectDirectoryDialog).
> I have a ListBox containing the list of folders, capable of
> navigating through the folders.
> Only thing that I miss is in navigation is changing drive.
> 
> How do I find all the available drive-letters and feed them to a
> ComboBox? Using GetLogicalDriveStrings, and thus using Windows unit
> breaks my other part of code (see comment on FindCloase at the end of
> function):
> 
> function FindFiles(Directory: string; InclAttr, ExclAttr: Integer;
>   const SubDirs: Boolean; const Files: TStrings): Integer;
> var
>   SearchRec: TSearchRec;
> begin
>   Directory := IncludeTrailingPathDelimiter(Directory);
>   FillChar(SearchRec, SizeOf(SearchRec), 0);
>   if FindFirst(Directory + '*.*', faAnyFile, SearchRec) = 0 then
>   begin
>     try
>       repeat
>         application.ProcessMessages;
>         if (SearchRec.Name <> '.') then
>           if ((SearchRec.Attr and InclAttr > 0) or ((SearchRec.Attr =
> 0) and (InclAttr <> faDirectory))) and
>             (SearchRec.Attr and ExclAttr = 0) then
>           begin
>             Files.Add(Directory + SearchRec.Name);
>             if SubDirs then
>               if SearchRec.Attr and faDirectory <> 0 then
>                 FindFiles(Directory + SearchRec.Name, InclAttr,
> ExclAttr, SubDirs, Files);
>           end;
>       until
>         FindNext(SearchRec) <> 0;
>     finally
>       FindClose(SearchRec);    // <-- Error: Incompatible type for
> arg no. 1: Got "TSearchRec", expected "LongWord"

Either change that to SysUtils.FindClose or put the Windows unit in
front of SysUtils.


Mattias


> 
>     end;
>   end;
>   Result := Files.Count;
> end;
> 
> 
> So, I need either a solution for FindClose or for finding drive
> letters without using Windows unit.
> 
> regards
> Boban Spasic
> 
> _________________________________________________________________
>      To unsubscribe: mail [EMAIL PROTECTED] with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to