Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rcahoon

Pages: [1]
1
Tracy,

Matt from Chilkat provided me with the solution. Turns out you need to run Global.FinaliseThreadPool prior to releasing your task and global objects in VFP. Once I added this call to my shutdown routine the asynch events started working just fine. That said, I've only done fairly straight forward testing so far.

As I see it, both linked events and asynch callbacks provide you with the basic ability to track and/or abort the current process though I would like to use asynch methods for the improved performance offered due to the ability to take advantage of multiple, pooled threads.

Did your solution use the Finalise Thread pool command and still have issues in VFP?

Cheers,

Rob

2
Hi,

I am trying to use the Chilkat ZIP ActiveX dll in our VFP9 system and I'm having problems making the Async methods work.

Basically, everything works perfectly until I release my task object which results in VFP9 crashing. This doesn't occur using the non-async methods.

Anyone have any pointers as to what might be wrong??

Code: [Select]
LOCAL lotask, lozip, lnsuccess, lnrecurse, lcfolder

lcappendfrom = "D:\DATA\SHF"
lcfilespec = "APPS\*"
lnrecurse = 1

lozip = CREATEOBJECT('Chilkat_9_5_0.Zip')
lozip.unlockcomponent("unlock")

lnsuccess = lozip.newzip("_myZip.zip")

lozip.appendfromdir = lcappendfrom
lnsuccess = lozip.appendfiles(lcfilespec,lnrecurse)

lotask = lozip.writezipandcloseasync()

lnsuccess = lotask.RUN()
IF (lnsuccess <> 1) THEN
? lotask.lasterrortext
CANCEL
ENDIF

lncurpctdone = 0
DO WHILE lotask.finished <> 1

IF (lotask.percentdone <> lncurpctdone) THEN
lncurpctdone = lotask.percentdone
WAIT WINDOW STR(lncurpctdone) + " %" NOWAIT
ENDIF

*  Sleep 100 ms.
loTask.SleepMs(100)
ENDDO

MESSAGEBOX( "WriteZipandClose Complete: " + ALLTRIM(STR(lnsuccess)))

MESSAGEBOX( lotask.StatusInt)
MESSAGEBOX( lotask.getresultint())

RELEASE lotask            && THIS COMMAND CRASHES VFP9

RETURN

Cheers,

Rob

Pages: [1]