login about faq

I downloaded the release version of 9.4.1 yesterday. This is the code which worked perfectly with 9.3.2:

WIN32_FIND_DATA FindFileData;
HANDLE hFind;
CkZipEntry *entry = 0;
int continue = 1;
hFind = FindFirstFile(szPath, &FindFileData);
while ((continue == 1) && (hFind != INVALID_HANDLE_VALUE)) {
    entry = zip.FirstMatchingEntry(FindFileData.cFileName);
    if (entry != NULL) {
        zip.DeleteEntry(entry);
    }
    if (FindNextFile(hFind, &FindFileData) == 0) {
        continue = 0;
    }
}
(void)FindClose(hFind);
delete entry;

Now, compiling this code with 9.4.1 results in a error: 'CkZip::DeleteEntry' : cannot convert parameter 1 from 'CkZipEntry *' to 'CkZipEntry &'

Attempting to use a pointer or cast results in a crash at runtime. I downloaded the chilkat-9.4.1-x86-vc9-sp1 archive.

"DeleteEntry" can no longer be found in the CkZip documentation, is there a reason for this?

asked Jul 18 '13 at 10:00

upeters's gravatar image

upeters
1112

edited Jul 18 '13 at 10:18


In v9.4.1, methods that have Chilkat objects for arguments will pass them by reference instead of via pointers. For example:

    bool DeleteEntry(CkZipEntry &entry);
Your code should look like this:
    entry = zip.FirstMatchingEntry(FindFileData.cFileName);
    if (entry != NULL) {
        zip.DeleteEntry(*entry);
    }

The online reference documentation and release notes will be updated ASAP. The underlying reason for the changes is for consistency for generating various kinds of wrappers (for Objective-C, DLL functions, and as many will find out in the near future, C++/CX and Mono C# wrappings). It's been a long migration path, but in general, Chilkat is moving in the direction where everything at the outer-layers is auto-generated by an internally defined API spec, and this allows for potential changes and improvements across-the-board at the outer layers of any API.

For v9.4.1, if there is a compile error, check the class definition. For example, you may find that an argument previously declared as "long" is now an "int".

link

answered Jul 18 '13 at 11:23

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Thank you. I made the change in my code, but as I still getting a crash with 9.4.1.0, I am stepping through the code in the debugger. I get an access violation when executing zip.QuickAppend(szZipFile). I don't see a mention in the documentation that here was a change.

link

answered Jul 18 '13 at 13:05

upeters's gravatar image

upeters
1112

Thanks! Please send me a simple code snippet along with an existing .zip file such that I can reproduce the problem. (The .zip would be the zip archive onto which you're appending new files.) Send this to support@chilkatsoft.com

(Jul 18 '13 at 13:08) chilkat ♦♦

The issue is with the callback. QuickAppend works without a callback. In my application I interface with Lua, and the stack gets corrupted with this build, causing the problem I see. Perhaps another customer who isn't using Lua will be able to confirm the problem later, with a source which would be easier to share for reproducing the issue.

(Jul 18 '13 at 17:06) upeters
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:

×20

Asked: Jul 18 '13 at 10:00

Seen: 1,193 times

Last updated: Jul 18 '13 at 17:06

powered by OSQA