(Unicode C++) Transition from Zip.GetEntryByID to Zip.EntryById
Provides instructions for replacing deprecated GetEntryByID method calls with EntryById. Note: This example requires Chilkat v11.0.0 or greater.
#include <CkZipW.h>
#include <CkZipEntryW.h>
void ChilkatSample(void)
{
CkZipW zip;
// ...
// ...
int id = 123;
// ------------------------------------------------------------------------
// The GetEntryByID method is deprecated:
CkZipEntryW *entryObj = zip.GetEntryByID(id);
if (zip.get_LastMethodSuccess() == false) {
wprintf(L"%s\n",zip.lastErrorText());
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.
CkZipEntryW ze;
bool success = zip.EntryById(id,ze);
if (success == false) {
wprintf(L"%s\n",zip.lastErrorText());
return;
}
}
|