Sample code for 30+ languages & platforms
C++

Transition from Zip.GetEntryByID to Zip.EntryById

Provides instructions for replacing deprecated GetEntryByID method calls with EntryById.

Chilkat C++ Downloads

C++
#include <CkZip.h>
#include <CkZipEntry.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkZip zip;

    //  ...
    //  ...
    int id = 123;

    //  ------------------------------------------------------------------------
    //  The GetEntryByID method is deprecated:

    CkZipEntry *entryObj = zip.GetEntryByID(id);
    if (zip.get_LastMethodSuccess() == false) {
        std::cout << zip.lastErrorText() << "\r\n";
        return;
    }

    //  ...
    //  ...

    delete entryObj;

    //  ------------------------------------------------------------------------
    //  Do the equivalent using EntryById.
    //  Your application creates a new, empty ZipEntry object which is passed 
    //  in the last argument and filled upon success.

    CkZipEntry ze;
    success = zip.EntryById(id,ze);
    if (success == false) {
        std::cout << zip.lastErrorText() << "\r\n";
        return;
    }
    }