Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: onytoo
  Where is onytoo?
 Padang
 Indonesia
 onytoo
 To: Miguel Brigidano
  Where is Miguel Brigidano?
 Madrid
 Spain
 Miguel Brigidano
 Tags
Subject: RE: vfp2c32.fll
Thread ID: 310794 Message ID: 310956 # Views: 51 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Monday, June 27, 2011 1:27:00 PM         
   


> >
> >
> > What exactly did you meant with kill the thread?
> > It will destroy if you destroy the thread object.
> > To remove object from memory just do this:
> >
> >
> >
> > thisform.oSaveThread = NULL
> > 

> >
> >
> > Regards,
> > Onytoo
>
> I have created a thead with mtdll with a query. For complete this task and return focus to procedure 'oncallcomplete' is about 2 minutes.
>
> During this time I have a progressbar in my main form, but i want can to cancel this task with 'ESC' key, for example.
> For cancel the loop of the progressbar is easy, but if write the sentence 'thisform.oSaveThread = NULL', this not cancel the thread process and i have to wait until the procedure 'oncallcomplete'.
>
> Could you tell me How can i do it?
>
> Regards


This is a dangerous work, i think!
But maybe you can cancel the job with one call to AbortCall function
( I never test and using this before! )


*!* on thread call, save call_id
thisform.nCallID = thisform.oThread.SaveData()


*!* thread abort
thisform.oThread.AbortCall(thisform.nCallID)


*!* in dll
lnResult = 1

*!* put this after SQLEXEC() in dll
IF this.CallInfo.Aborted()
  lnResult = -1
  *!* EXIT && if in loop
ENDIF

RETURN lnResult



Regards,
Onytoo

ENTIRE THREAD

vfp2c32.fll Posted by Miguel Brigidano @ 6/24/2011 12:47:40 PM
RE: vfp2c32.fll Posted by onytoo @ 6/25/2011 9:42:56 AM
RE: vfp2c32.fll Posted by Miguel Brigidano @ 6/27/2011 9:16:29 AM
RE: vfp2c32.fll Posted by onytoo @ 6/27/2011 1:27:00 PM
RE: vfp2c32.fll Posted by Miguel Brigidano @ 6/30/2011 9:21:56 AM
RE: vfp2c32.fll Posted by onytoo @ 6/30/2011 9:35:46 AM
RE: vfp2c32.fll Posted by Miguel Brigidano @ 6/30/2011 9:46:05 AM
RE: vfp2c32.fll Posted by onytoo @ 6/30/2011 11:46:21 AM
RE: vfp2c32.fll Posted by Miguel Brigidano @ 6/30/2011 12:17:12 PM
RE: vfp2c32.fll Posted by onytoo @ 6/30/2011 4:47:40 PM
RE: vfp2c32.fll Posted by Miguel Brigidano @ 7/1/2011 9:47:12 AM
RE: vfp2c32.fll Posted by onytoo @ 7/1/2011 10:26:52 AM