Page 1 of 1

CHILKAT

Posted: Thu Mar 23, 2023 6:23 am
by MIGUELON
Hi Tom, you can't imagine the gift you gave me by running the Childkat bookstore.
It's great and solves a lot of problems for me.
It is also very easy to implement, you just have to remove the THEN and replace the period with:
I just haven't been able to implement "Progress Event Callbacks" yet, could you post an example?
Thank you so much

Re: CHILKAT

Posted: Thu Mar 23, 2023 9:40 am
by Tom
Good to hear this great library works well for you, but I don't understand your request. Could you show it or be a little more precise? What are you talking about?

Re: CHILKAT

Posted: Thu Mar 23, 2023 10:58 am
by MIGUELON
Tom I want to see a progress bar when I FTP a file or when I ZIP it

Re: CHILKAT

Posted: Fri Mar 24, 2023 2:05 am
by Tom
This is what the chilkat docs say:
async_ax.png
async_ax.png (18.38 KiB) Viewed 2660 times
I didn't try to process background callbacks. My SFTP client built with chilkat shows a dialog with a progress bar (marquee, no percentage) while the upload goes on. The progress bar is removed in the moment the upload method finishes.

Re: CHILKAT

Posted: Fri Mar 24, 2023 2:22 am
by MIGUELON
Ok, from what I understand what you do is a dummy status bar that disappears when the process ends.
Thank you again Tom

Re: CHILKAT

Posted: Fri Mar 24, 2023 2:43 am
by Piotr D
Hi Miguelon,
you can try something like this:

zip:=CreateObject("Chilkat_9_5_0.Zip")
zip:NewZip(cArcFile)

zip:PasswordProtect:=1
zip:EncryptPassword:=m_sigha()
* capture callback slots
zip:=zip:dynamicCast("ActiveXObject")

FOR i := 1 TO LEN(aFileList)
IF oPrzerwanoSignal:wait(1) // waiting for user's cancel
M_ABORT := .T.
RETURN(.F.)
ENDIF
M_Licznik := 0
* oPostep1 is a progressbar
oPostep1:current:=1
M_Plik := ALLTRIM(aFileList)
M_Plik := SubStr(M_Plik,RAt("\",M_Plik)+1)
* we set the callback slot PercentDone of the ZIP object to pass the information
* about the advancement of subsequent methods to the file packing progress bar
zip:PercentDone:={|a|oPostep1:current:=a}

* adds a file to an object - this doesn't pack it yet
IF zip:AppendFiles(ALLTRIM(aFileList),1)=1
IF i=1
* I pack the first file into a defined file and close it
IF zip:WriteZipAndClose()=0
EXIT
ENDIF
* I create a new object so that it always contains only one packaged file
zip:NewZip(cArcFile)
ELSE
* subsequent files are appended to the existing ZIP file
IF zip:QuickAppend(cArcFile)=0
EXIT
ELSE
IF i<LEN(aFileList)
* I create a new object so that it always contains only one packaged file
zip:NewZip(cArcFile)
ELSE
lReturn:=.T.
EXIT
ENDIF
ENDIF
ENDIF
ENDIF
NEXT

Regards
Piotr

Re: CHILKAT

Posted: Fri Mar 24, 2023 5:52 am
by Tom
Cool.