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.


Topics - rcahoon

Pages: [1]
1
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]