Archived Forum Post

Index of archived forum posts


Event callbacks in CkDecryptFile not working as expected

Oct 28 '13 at 11:43

I cannot get void PercentDone(int pctDone, bool abort) and void ProgressInfo(const char name, const char *value) event callbacks to work with CkCrypt2Progress in C++. In e.g. CkZipProgress these callbacks work just fine.

I have tried to lower the put_HeartbeatMs to e.g. 2ms, but still no difference. However the void AbortCheck(bool *abort) callback works fine. I have also tried with different file sizes (just-in-case).

I am using the VC++ 11 / 32bit / v110_xp libraries version

My derived code looks like this:

#include "CkCrypt2Progress.h"
#include "ProgressDualDlg.h"

class Crypt2Progress : public CkCrypt2Progress  
    CProgressDualDlg *localDlg;
    Crypt2Progress(CProgressDualDlg *dlg) : localDlg(dlg)   { }
    virtual ~Crypt2Progress() { }

    void AbortCheck(bool *abort) 
        if (localDlg->IsStopped()) <-- breakpoint hit
            *abort = true;
    void PercentDone(int pctDone, bool *abort)
        if (localDlg->IsStopped()) <-- breakpoint never hit
            *abort = true;

    void ProgressInfo(const char *name, const char *value)
        CString csName(name); <-- breakpoint never hit
        CString csValue(value);

Accepted Answer

These new builds should fix the problem with PercentDone not getting called:



The PercentDone will also count as an AbortCheck event, therefore the AbortCheck events will only be called when enough time elapses between 1% increments.

There are no actual ProgressInfo events in this case, so it won't fire.