login about faq

I have set the following:

_ftp.put_EventCallbackObject(&_ftpProgress);

_ftp.put_Hostname(_host.c_str());
_ftp.put_Username(_user.c_str());
_ftp.put_Password(_password.c_str());

_ftp.put_Passive(false);
_ftp.put_HeartbeatMs(250);
_ftp.put_SendBufferSize(4096);

But i am never getting calls to my FtpPercentDone method. Only AbortCheck

asked Aug 16 '13 at 14:00

iifuzz's gravatar image

iifuzz
1339


The percent-done event callbacks in v9.4.1 have been standardized to be named "PercentDone". Also take care to use "int" instead of "long" for the integer argument. See the CkFtpProgress.h --

    // Changed from "FtpPercentDone" to "PercentDone"
    virtual void PercentDone(int pctDone, bool *abort) { }
    //virtual void FtpPercentDone(long pctDone, bool *abort) { }

link

answered Aug 16 '13 at 18:37

chilkat's gravatar image

chilkat ♦♦
12.8k317363471

We seem to be having a similar problem with FtpPercentDone. Our original license was for the VC6 libraries - we tested new ChilKat libraries with 2017 and will be moving to that license. However we still have one legacy application that uses vs2008 and when it is compiled with the vc6 libraries we never get a call back in the FtpPercentDone method. Unicode, Multibyte, MT, DLL,

void FtpPercentDone (long pctDone, bool abort) void FtpPercentDone (int pctDone, bool abort)

ftp.GetFile2 (ckRemoteFileName, ckLocalFileName, myProgress))

ftp.put_EventCallbackObject (&myProgress); ftp.GetFile (remoteFileName, localFileName))

no combination of libraries, method calls, etc. will ever fire an event back to FtpPercentDone?

Any help would be sorely appreciated...

Tks, Mike

link

answered Jun 14 at 15:23

mikeF's gravatar image

mikeF
11

Got it to work .. not sure why but with new compiler it seems the method:

ftp.put_AutoGetSizeForProgress (true);

must be called before percent callbacks are issued..??

link

answered Jun 14 at 17:32

mikeF's gravatar image

mikeF
11

Yes, because some FTP servers, depending on the implementation, will indicate the file size in the intermediate response, whereas others do not. If an FTP server does not indicate the file size in the intermediate response, then there's no way to know the percentage done. The AutoGetSizeForProgress tells Chilkat to make sure it gets the remote file size first.

(Jun 14 at 17:40) chilkat ♦♦

But AutoGetSizeForProgress can be bad if the directory contains a huge number of files, and each file is small. The overhead for getting the file size (by automatically fetching the directory listing) may be ridiculous for tracking the progress of a small file. (But the directory listing is cached in memory by Chilkat, so it wouldn't re-download the listing for every file to be downloaded.)

(Jun 14 at 17:44) chilkat ♦♦

I think you're confusing the version of VC++ vs. the version of Chilkat.

Each new version of Chilkat is released for all versions of VC++. For example, Chilkat v9.5.0.68 can be used on VC6, VC9, VC2017, etc.

If you're using an ancient version of Chilkat (such as v9.4.1), then the callback method was named "FtpPercentDone".

If you're using a version of Chilkat since then, regardless of VC++ version, then the callback method is named "PercentDone". The callback mechanism is based on overriding a virtual method in a base class. Your application will define a class that derives from CkFtp2Progress, which is defined in CkFtp2Progress.h. If you examine the CkFtp2Progress.h header, you'll see that it's derived from CkBaseProgress (defined in CkBaseProgress.h). One of the virtual methods in CkBaseProgress.h is:

virtual void PercentDone(int pctDone, bool *abort) 

Your application's progress callback class would include a method to override it.

link

answered Jun 14 at 17:38

chilkat's gravatar image

chilkat ♦♦
12.8k317363471

Tks for the quick answer. Makes sense...

True - we are in a bit of a version ^^&())* purgatory at the moment. We bought the original ChilKat license back when punch-cards where just coming into vogue... I think the ChilKat version was somewhere around .. 0.00001. :)

If we have a license that was originally bought for the v9.4 libraries will it work with newer versions?

One thing I can say for sure - we have beat the ChilKat software for years and it just holds up. If we could only get the government to be as efficient we could all be coding on our yachts...

Tks, agsin.. good company, good people.. Mike

link

answered Jun 14 at 18:04

mikeF's gravatar image

mikeF
11

Tks for the quick answer. Makes sense...

True - we are in a bit of a version ^^&())* purgatory at the moment. We bought the original ChilKat license back when punch-cards where just coming into vogue... I think the ChilKat version was somewhere around .. 0.00001. :)

If we have a license that was originally bought for the v9.4 libraries will it work with newer versions?

One thing I can say for sure - we have beat the ChilKat software for years and it just holds up. If we could only get the government to be as efficient we could all be coding on our yachts...

Tks, again.. good company, good people.. Mike

link

answered Jun 14 at 18:35

mikeF's gravatar image

mikeF
11

edited Jun 14 at 18:35

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×86
×22

Asked: Aug 16 '13 at 14:00

Seen: 1,649 times

Last updated: Jun 14 at 18:35

powered by OSQA