TFindFile - REQUEST

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

TFindFile - REQUEST

Postby Okann » May 24th, 2011, 12:22 pm

Dear delphi area,

I need a pause and continue function for TFindFile component

I would be glad if you help..

Regards,,
Okann
Active Member
Active Member
 
Posts: 6
Joined: May 24th, 2011, 12:16 pm

Use a sync object to pause/resume TFindFile

Postby Kambiz » May 24th, 2011, 9:39 pm

First of all, you should use TFindFile in threaded mode, so that you can pause or resume its thread.

An easy but unsafe solution is pausing/resuming the thread object. The change of deadlock is high, and besides that Pause and Resume methods of TThread class are deprecated now.

A better solution is using a synchronization object to put the thread in the wait state whenever is needed. Usually, the pause is needed when the user should do some actions regarding the last found item. So, it's better we save time and keep searching while the user is making a decision. We only have to really pause the search when another item is found.

You will find a sample implementation of the above in the attached file.
Attachments
FindFile_PauseResume.zip
Pausing/Resuming TFindFile search using an event object.
(2.34 KiB) Downloaded 96 times
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Re: TFindFile - REQUEST

Postby Okann » May 24th, 2011, 11:11 pm

Thank you very much for your interest...

Regards,
Okann
Active Member
Active Member
 
Posts: 6
Joined: May 24th, 2011, 12:16 pm

Re: TFindFile - REQUEST

Postby Okann » September 9th, 2011, 11:34 pm

hello,

Do you compile this component for Delphi XE and XE2?

regards...
Okann
Active Member
Active Member
 
Posts: 6
Joined: May 24th, 2011, 12:16 pm

Re: TFindFile - REQUEST

Postby Kambiz » September 10th, 2011, 2:27 pm

I don't think so. For the moment, I am not going to spend more time on Delphi.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Re: TFindFile - REQUEST

Postby Okann » September 10th, 2011, 2:55 pm

DELPHIAREA.INC

is sufficient to add the following code?

.
.
.

{$DEFINE COMPILER2012_UP}
{$DEFINE COMPILER2011_UP}
{$DEFINE COMPILER2010_UP}
{$DEFINE COMPILER2009_UP}
{$DEFINE COMPILER2007_UP}
{$DEFINE COMPILER2006_UP}
{$DEFINE COMPILER2005_UP}
{$DEFINE COMPILER7_UP}
{$DEFINE COMPILER6_UP}
{$DEFINE COMPILER5_UP}
{$DEFINE COMPILER4_UP}
{$DEFINE COMPILER3_UP}
{$DEFINE COMPILER2_UP}

{ Then detect if it is older (.NET versions are ignored) }


{$IFDEF VER230} // Delphi XE2

{$ENDIF}

{$IFDEF VER220} // Delphi XE

{$ENDIF}

{$IFDEF VER210} // Delphi 2010

{$ENDIF}

.
.
.
Okann
Active Member
Active Member
 
Posts: 6
Joined: May 24th, 2011, 12:16 pm

Re: TFindFile - REQUEST

Postby Kambiz » September 10th, 2011, 3:16 pm

Okann,

The inc file does not need to be modified because it is only needed for Delphi 2007 and earlier.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Re: TFindFile - REQUEST

Postby Okann » September 10th, 2011, 3:48 pm

thank you dear Kambiz
Okann
Active Member
Active Member
 
Posts: 6
Joined: May 24th, 2011, 12:16 pm

Re: TFindFile - REQUEST

Postby Okann » January 2nd, 2014, 12:06 pm

Dear Kambiz,

FindFile_PauseResume.zip corrupted archives


please reupload


Regards...
Okann
Active Member
Active Member
 
Posts: 6
Joined: May 24th, 2011, 12:16 pm

Re: TFindFile - REQUEST

Postby Kambiz » January 12th, 2014, 8:50 pm

I'm really sorry but my backup files are corrupted too. :(
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 3 guests

cron