TFindFile and WaitFor

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

TFindFile and WaitFor

Postby Kimbo » August 28th, 2012, 3:49 am

First, thanks for this awesome component!!!

I'm trying to perform several different task using one FindFile component. This FindFile created run-time. Let's see this execute pseudocode:

Code: Select all
for i := Low(Task) to High(Task) do begin
  FindFile.Threaded := True; { must }
  FindFile.Criteria...
  FindFile.OnFileMatch := ...
  ...
  FindFile.Execute;
end;


Since the FindFile are in threaded mode, so this "for" routine is not working properly. Is there any clue about WaitFor method that can be used so this kind of loop routine able to do its job, and without having to make the main thread (main form) hang?

Thanks in advance!
Kimbo
Member
Member
 
Posts: 1
Joined: August 28th, 2012, 3:44 am

Re: TFindFile and WaitFor

Postby Kambiz » August 28th, 2012, 10:56 am

WaitFor blocks the calling thread anyway.
Instead of using a single instance of TFindFile to run the tasks one by one, I do suggest to create a new threaded instance of TFindFile for each task, so you can do all tasks simultaneously.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 43 guests

cron