Sample code for 30+ languages & platforms
C++

Transition from Zip.FirstEntry to Zip.EntryAt

Provides instructions for replacing deprecated FirstEntry method calls with EntryAt.

Chilkat C++ Downloads

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

void ChilkatSample(void)
    {
    bool success = false;

    CkZip zip;

    //  ...
    //  ...

    //  ------------------------------------------------------------------------
    //  The FirstEntry method is deprecated:

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

    //  ...
    //  ...

    delete entryObj;

    //  ------------------------------------------------------------------------
    //  Do the equivalent using EntryAt.

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

    //  The 1st entry is at index 0.
    CkZipEntry ze;
    success = zip.EntryAt(0,ze);
    if (success == false) {
        std::cout << zip.lastErrorText() << "\r\n";
        return;
    }
    }