Click here to Skip to main content
15,867,568 members
Articles / Desktop Programming / MFC

Zip Utils - Clean, Elegant, Simple, C++/Win32

Rate me:
Please Sign up or sign in to vote.
4.90/5 (237 votes)
19 Sep 2012Public Domain8 min read 4.3M   44.6K   437   638
Adding zip/unzip easily, no LIBS or DLLs, with an elegant and powerful API

zipping and unzipping in action!

Introduction

WARNING: This code has known bugs. It doesn't deal with non-ASCII filenames correctly. It doesn't deal with passwords correctly. I don't have time to fix it, unfortunately. But I've marked it so that other gold members can edit it, in case anyone wants to make the fix.

 

This source code shows how to add zip/unzip functionality to your programs. Lots of people have written their own wrappers around Zip, and indeed there are several articles on CodeProject that are based on earlier versions of my own code. How is this version different?

  • Clean packaging. There's one pair of files zip.cpp, zip.h to add to your project if you want zip. Another pair unzip.cpp, unzip.h if you want unzip (or both if you want both!). There are no additional libraries or DLLs to worry about.
  • Clean API. Most other APIs around zip/unzip are terrible. This one is the best. The API is short, clean, and in a familiar Win32 style. Most other APIs wrap things up in classes, which is ugly overkill for such a small problem and always turn out to be too inflexible. Mine doesn't. See the code snippets below.
  • Flexibility. With this code, you can unzip from a zip that's in a disk file, memory-buffer, pipe. You can unzip into a disk file, memory-buffer or pipe. The same for creating Zip files. This means that at last you don't need to write out your files to a temporary directory before using them! One noteworthy feature is that you can unzip directly from an embedded resource into a memory buffer or onto a disk file, which is great for installers. Another is the ability to create your Zip in dynamically growable memory backed by the system page file. Despite all this power, the API remains clean and simple. The power didn't come from just writing wrappers around other people's code. It came from restructuring the internals of zlib and info-zip source code. My code is unique in what it does here.
  • Encryption. This version supports password-based Zip encryption. Passwords are absent from many other Zip libraries, including gzip.
  • Unicode. This version supports Unicode filenames.
  • Windows CE. This version works as it is under Windows CE. No need to alter makefiles or #defines, or worry about compatibility of any LIB/DLL.
  • Bug fixes. This code is based on gzip 1.1.4, which fixes a security vulnerability in 1.1.3. (An earlier version of my code used 1.1.3, and has crept into other CodeProject articles...).

At its core, my code uses zlib and info-zip. See the end of the article for acknowledgements & license.

Using the Code

To add zip functionality to your code, add the file zip.cpp to your project, and #include "zip.h" to your source code.

Similarly for unzipping, add the file unzip.cpp to the project and #include "unzip.h" to your source code. Zip and unzip can co-exist happily in a single application. Or you can omit one or the other if you're trying to save space.

The following code snippets show how to use zip/unzip. They are taken from one of the demo applications included in the download. It also has project files for Visual Studio .NET and Borland C++ Builder6 and Embedded Visual C++ 3. The code snippets here use ASCII. But the functions all take arguments of type TCHAR* rather than char*, so you can use it fine under Unicode.

Example 1 - Create a Zip File from Existing Files

C#
// We place the file "simple.bmp" inside, but inside
// the zipfile it will actually be called "znsimple.bmp".
// Similarly the textfile.

HZIP hz = CreateZip("simple1.zip",0);
ZipAdd(hz,"znsimple.bmp",  "simple.bmp");
ZipAdd(hz,"znsimple.txt",  "simple.txt");
CloseZip(hz);

Example 2 - Unzip a Zip File Using the Names It Has Inside It

C#
HZIP hz = OpenZip("\\simple1.zip",0);
ZIPENTRY ze; GetZipItem(hz,-1,&ze); int numitems=ze.index;
// -1 gives overall information about the zipfile
for (int zi=0; zi<numitems; zi++)
{ ZIPENTRY ze; GetZipItem(hz,zi,&ze); // fetch individual details
  UnzipItem(hz, zi, ze.name);         // e.g. the item's name.
}
CloseZip(hz);

Example 3- Unzip from Resource Directly into Memory

This technique is useful for small games, where you want to keep all resources bundled up inside the executable, but restricting the size.

Suppose we used a .rc with 1 RCDATA "file.zip" to embed the zip file as a resource.

C#
HRSRC hrsrc = FindResource(hInstance,MAKEINTRESOURCE(1),RT_RCDATA);
HANDLE hglob = LoadResource(hInstance,hrsrc);
void *zipbuf = LockResource(hglob);
unsigned int ziplen = SizeofResource(hInstance,hrsrc);
hz = OpenZip(zipbuf, ziplen, 0);
ZIPENTRY ze; int i; FindZipItem(hz,"sample.jpg",true,&i,&ze);
// that lets us search for an item by filename.
// Now we unzip it to a membuffer.
char *ibuf = new char[ze.unc_size];
UnzipItem(hz,i, ibuf, ze.unc_size);
...
delete[] ibuf;
CloseZip(hz);
// note: no need to free resources obtained through Find/Load/LockResource

Example 4 - Unzip Chunk by Chunk to a membuffer

Normally when you call UnzipItem(...), it gives the return-code ZR_OK. But if you gave it too small a buffer so that it couldn't fit it all in, then it returns ZR_MORE.

C#
char buf[1024]; ZRESULT zr=ZR_MORE; unsigned long totsize=0;
while (zr==ZR_MORE)
{ zr = UnzipItem(hz,i, buf,1024);
  unsigned long bufsize=1024; if (zr==ZR_OK) bufsize=ze.unc_size-totsize;
  ... maybe write the buffer to a disk file here
  totsize+=bufsize;
}

Common Questions

STRICT? I think you should always compile with STRICT (in project-settings/preprocessor/defines), and full warnings turned on. Without STRICT, the HZIP handle becomes interchangeable with all other handles.

How to show a progress dialog? One of the included examples, "progress", shows how to do this.

How to add/remove files from an existing Zip file? The zip_utils currently only allows you to OpenZip() for unzipping, or CreateZip() for adding, but don't allow you to mix the two. To modify an existing zip (e.g.: adding or removing a file), you need to create a new zip and copy all the existing items from the old into the new. One of the included examples, "modify", shows how to do this. It defines two functions:

C#
ZRESULT RemoveFileFromZip(const TCHAR *zip, const TCHAR *name);
ZRESULT AddFileToZip(const TCHAR *zip, const TCHAR *name, const TCHAR *fn);
// eg. AddFileToZip("c:\\archive.zip","znsimple.txt","c:\\docs\\file.txt");
// If the zipfile already contained that thing (case-insensitive), it is removed.
// These two functions are defined in "modify.cpp"

"fatal error C1010: unexpected end of file while looking for precompiled header directive". To fix this, select zip.cpp and unzip.cpp and change Project > Settings > C++ > PrecompiledHeaders to NotUsingPrecompiledHeaders.

Discussion

Efrat says: "I think the design is very bad", and so objects when I say that my API is clean and others are not. (Actually, he says my documentation is the most conceited he's seen and my design is the worst that he's seen!) I've reproduced his comments here, with my responses, so you can make a more informed decision whether to use my library.

  • [Efrat] Better instead to use the boost IOStream library.

    [Response] I love the boost library. If people can figure out how to add it to their projects and zip/unzip with it, they should definitely use boost rather than my code. (I'm still trying to figure it out, though, and couldn't get it to compile under CE.)

  • [Efrat] A compressed archive has internal state; it's a classic object; the author's criticisms of OOP are unjustified. "OOP doesn't mean placing your code in a CPP file."

    [Response] I'm trying not to be OOP.

    1. You'll never inherit from an archive, nor invoke virtual methods from it: we only use encapsulation, not any of the other pillars of OOP. By using an opaque handle HZIP rather than a class, I indicate this clearly to the programmer. Also,
    2. C++ classes don't work cleanly across DLLs. Handles like HZIPs do.
  • [Efrat] For instance, progress-notifications should be done by virtual functions in a derived class, not by callbacks.

    [Response] To get progress, you invoke UnzipItem in a while loop, and each iteration unzips a little bit more of the file. This is clean, re-entrant, and has a simple API. I think this is an easier API than inheriting from a class. I think inheritance from library classes is bad, in general.

  • [Efrat] Compression should go in a DLL.

    [Response] I disagree. DLLs are always pain, for developers as well as users. Unzip only adds 40K in any case.

  • [Efrat] The API doesn't use the type system to differentiate between an HZIP for zipping and an HZIP for unzipping.

    [Response] This was intentional. The difference between zipping and unzipping is a current implementation drawback. I think an API should be clean, "inspirational", and you shouldn't encode current implementation limitations into the type system.

  • [Efrat] The API uses error-codes, rather than exceptions, but anyone who has graduated Programming 101 knows exceptions are better.

    [Response] I think exceptions are not welcomed anywhere nearly as widely as Efrat suggests. Also, they don't work cleanly across DLL boundaries, and they don't work on Pocket PC.

  • [Efrat] The API is inflexible; it should be coded for change, not just coded for all the options that were conceived while designing (handles, files, memory). Most users will think of sources and targets which this design can't support.

    [Response] The original Zip uses FILE*s, which are effectively the same as Windows pipes. I also provided memory-buffers which add an enormous amount of flexibility that's easy to use and requires no additional programming. For any user who needs sources and targets which can't be reached via a memory buffer, they shouldn't use these zip_utils.

  • [Efrat] The is unnecessarily Windows-specific. The original zlib works great and is portable; zip_utils offers no advantages. Compression is memory-manipulation and IO and so should not be platform-specific.

    [Response] In the olden days before STL, "cross-platform" code inevitably meant:

    1. peppered with so many #ifdefs that you couldn't read it,
    2. didn't work straight away under Windows.

    I started from an old code-base, and so Efrat's proposed bottom-up rewrite was not possible. The advantage this code offers over zlib is that it's just a single file to add to your project, it works first time under Windows, you can add it easily as a CPP module to your project (not just dll/lib), and the API is simpler.

In general, Efrat wants code to be a clean extensible framework. I don't; I want small compact code that works fine as it is. Furthermore, I think that "framework-isation" is the biggest source of bugs and code overruns in the industry.

Acknowledgements

This version of article was updated on 28th July, 2005. Many thanks to the readers at CodeProject who found bugs and contributed fixes to an earlier version. There was one terrible bug where, after a large file had been unzipped, the next one might not work. Alvin77 spotted this bug.

My work is a repackaged form of extracts from the zlib code available at www.gzip.org by Jean-Loup Gailly and Mark Adler and others. Also from the info-zip source code at www.info-zip.org. Plus a bunch of my own changes. The original source code can be found at the two mentioned websites. Also the original copyright notices and licenses can be found there, and also inside the files zip.cpp and unzip.cpp of my code. As for licensing of my own contributions, I place them into the public domain.

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Technical Lead
United States United States
Lucian studied theoretical computer science in Cambridge and Bologna, and then moved into the computer industry. Since 2004 he's been paid to do what he loves -- designing and implementing programming languages! The articles he writes on CodeProject are entirely his own personal hobby work, and do not represent the position or guidance of the company he works for. (He's on the VB/C# language team at Microsoft).

Comments and Discussions

 
AnswerRe: Tips on Convert std::string to TCHAR* Pin
ljw10046-Mar-13 9:58
ljw10046-Mar-13 9:58 
QuestionProblem in ZRESULT UnzipItem(HZIP hz, int index, const TCHAR *fn) Pin
shawnee17-Feb-13 21:55
shawnee17-Feb-13 21:55 
AnswerRe: Problem in ZRESULT UnzipItem(HZIP hz, int index, const TCHAR *fn) Pin
liuliulyh9-Jul-13 21:10
liuliulyh9-Jul-13 21:10 
Questionperfect code! Pin
Member 96210119-Feb-13 21:55
Member 96210119-Feb-13 21:55 
Questiontar format Pin
Member 942146329-Oct-12 2:32
Member 942146329-Oct-12 2:32 
GeneralMy vote of 1 Pin
vvidov15-Oct-12 5:28
professionalvvidov15-Oct-12 5:28 
Suggestion[TUTORIAL] How to solve filename problems (with extended characters) Pin
Piel928-Oct-12 8:55
Piel928-Oct-12 8:55 
QuestionVisual studio 2010 getting errors in zip.h? Pin
Peter Nguyen1235-Oct-12 4:01
Peter Nguyen1235-Oct-12 4:01 
Any suggestions?


Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 13 1 KML-DAE-GEN
Error 4 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 17 1 KML-DAE-GEN
Error 5 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 17 1 KML-DAE-GEN
Error 7 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 22 1 KML-DAE-GEN
Error 8 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 22 1 KML-DAE-GEN
Error 10 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 22 1 KML-DAE-GEN
Error 12 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 23 1 KML-DAE-GEN
Error 14 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 23 1 KML-DAE-GEN
Error 16 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 24 1 KML-DAE-GEN
Error 20 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 24 1 KML-DAE-GEN
Error 23 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 56 1 KML-DAE-GEN
Error 26 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 56 1 KML-DAE-GEN
Error 29 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 57 1 KML-DAE-GEN
Error 32 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 57 1 KML-DAE-GEN
Error 36 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 58 1 KML-DAE-GEN
Error 39 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 58 1 KML-DAE-GEN
Error 42 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 59 1 KML-DAE-GEN
Error 45 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 59 1 KML-DAE-GEN
Error 49 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 60 1 KML-DAE-GEN
Error 52 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 60 1 KML-DAE-GEN
Error 55 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 75 1 KML-DAE-GEN
Error 58 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 75 1 KML-DAE-GEN
Error 61 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 81 1 KML-DAE-GEN
Error 64 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 81 1 KML-DAE-GEN
Error 69 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 190 1 KML-DAE-GEN
Error 72 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 190 1 KML-DAE-GEN
Error 46 error C2374: 'ZipAddHandle' : redefinition; multiple initialization c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 59 1 KML-DAE-GEN
Error 33 error C2374: 'ZipAdd' : redefinition; multiple initialization c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 57 1 KML-DAE-GEN
Error 82 error C2371: 'ULONG' : redefinition; different basic types c:\program files (x86)\microsoft sdks\windows\v7.0a\include\wtypes.h 386 1 KML-DAE-GEN
Error 83 error C2371: 'ULONG' : redefinition; different basic types c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winsmcrd.h 31 1 KML-DAE-GEN
Error 79 error C2371: 'DWORD' : redefinition; different basic types c:\program files (x86)\microsoft sdks\windows\v7.0a\include\windef.h 152 1 KML-DAE-GEN
Error 3 error C2146: syntax error : missing ';' before identifier 'ZRESULT' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 17 1 KML-DAE-GEN
Error 54 error C2146: syntax error : missing ';' before identifier 'ZipGetMemory' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 75 1 KML-DAE-GEN
Error 35 error C2146: syntax error : missing ';' before identifier 'ZipAddHandle' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 58 1 KML-DAE-GEN
Error 41 error C2146: syntax error : missing ';' before identifier 'ZipAddHandle' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 59 1 KML-DAE-GEN
Error 48 error C2146: syntax error : missing ';' before identifier 'ZipAddFolder' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 60 1 KML-DAE-GEN
Error 22 error C2146: syntax error : missing ';' before identifier 'ZipAdd' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 56 1 KML-DAE-GEN
Error 28 error C2146: syntax error : missing ';' before identifier 'ZipAdd' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 57 1 KML-DAE-GEN
Error 15 error C2146: syntax error : missing ';' before identifier 'CreateZipHandle' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 24 1 KML-DAE-GEN
Error 6 error C2146: syntax error : missing ';' before identifier 'CreateZip' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 22 1 KML-DAE-GEN
Error 11 error C2146: syntax error : missing ';' before identifier 'CreateZip' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 23 1 KML-DAE-GEN
Error 68 error C2146: syntax error : missing ';' before identifier 'CloseZipZ' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 190 1 KML-DAE-GEN
Error 60 error C2146: syntax error : missing ';' before identifier 'CloseZip' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 81 1 KML-DAE-GEN
Error 25 error C2146: syntax error : missing ')' before identifier 'hz' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 56 1 KML-DAE-GEN
Error 31 error C2146: syntax error : missing ')' before identifier 'hz' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 57 1 KML-DAE-GEN
Error 38 error C2146: syntax error : missing ')' before identifier 'hz' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 58 1 KML-DAE-GEN
Error 44 error C2146: syntax error : missing ')' before identifier 'hz' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 59 1 KML-DAE-GEN
Error 51 error C2146: syntax error : missing ')' before identifier 'hz' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 60 1 KML-DAE-GEN
Error 57 error C2146: syntax error : missing ')' before identifier 'hz' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 75 1 KML-DAE-GEN
Error 63 error C2146: syntax error : missing ')' before identifier 'hz' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 81 1 KML-DAE-GEN
Error 71 error C2146: syntax error : missing ')' before identifier 'hz' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 190 1 KML-DAE-GEN
Error 76 error C2146: syntax error : missing ')' before identifier 'hz' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 192 1 KML-DAE-GEN
Error 19 error C2146: syntax error : missing ')' before identifier 'h' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 24 1 KML-DAE-GEN
Error 66 error C2146: syntax error : missing ')' before identifier 'code' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 84 1 KML-DAE-GEN
Error 74 error C2146: syntax error : missing ')' before identifier 'code' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 191 1 KML-DAE-GEN
Error 9 error C2143: syntax error : missing ',' before '*' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 22 1 KML-DAE-GEN
Error 24 error C2086: 'int ZRESULT' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 56 1 KML-DAE-GEN
Error 30 error C2086: 'int ZRESULT' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 57 1 KML-DAE-GEN
Error 37 error C2086: 'int ZRESULT' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 58 1 KML-DAE-GEN
Error 43 error C2086: 'int ZRESULT' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 59 1 KML-DAE-GEN
Error 50 error C2086: 'int ZRESULT' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 60 1 KML-DAE-GEN
Error 56 error C2086: 'int ZRESULT' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 75 1 KML-DAE-GEN
Error 62 error C2086: 'int ZRESULT' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 81 1 KML-DAE-GEN
Error 70 error C2086: 'int ZRESULT' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 190 1 KML-DAE-GEN
Error 13 error C2086: 'int HZIP' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 23 1 KML-DAE-GEN
Error 17 error C2086: 'int HZIP' : redefinition c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 24 1 KML-DAE-GEN
Error 1 error C2065: 'HZIP' : undeclared identifier c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 13 1 KML-DAE-GEN
Error 18 error C2065: 'HANDLE' : undeclared identifier c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 24 1 KML-DAE-GEN
Error 21 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 24 1 KML-DAE-GEN
Error 27 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 56 1 KML-DAE-GEN
Error 34 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 57 1 KML-DAE-GEN
Error 40 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 58 1 KML-DAE-GEN
Error 47 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 59 1 KML-DAE-GEN
Error 53 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 60 1 KML-DAE-GEN
Error 59 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 75 1 KML-DAE-GEN
Error 65 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 81 1 KML-DAE-GEN
Error 67 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 84 1 KML-DAE-GEN
Error 73 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 190 1 KML-DAE-GEN
Error 75 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 191 1 KML-DAE-GEN
Error 78 error C2059: syntax error : ')' c:\users\peter\documents\visual studio 2010\projects\kml-dae-gen\kml-dae-gen\zip.h 192 1 KML-DAE-GEN
AnswerRe: Visual studio 2010 getting errors in zip.h? Pin
Piel928-Oct-12 8:34
Piel928-Oct-12 8:34 
BugUse of ZipUnzip without UNIcode seems to require 2 adaptions to zip.cpp (Add and HasZipSuffix) Pin
EJ Smits27-Sep-12 10:21
EJ Smits27-Sep-12 10:21 
GeneralMy vote of 5 Pin
Michael Haephrati18-Sep-12 10:42
professionalMichael Haephrati18-Sep-12 10:42 
GeneralMy vote of 4 Pin
soulprovidergr18-Sep-12 0:29
soulprovidergr18-Sep-12 0:29 
QuestionBzip2? Pin
xComaWhitex17-Sep-12 16:55
xComaWhitex17-Sep-12 16:55 
Questionunzip from memory not working Pin
plevintampabay17-Sep-12 9:49
plevintampabay17-Sep-12 9:49 
QuestionFix for bug in unzip with password Pin
CodeHead14-Sep-12 3:10
CodeHead14-Sep-12 3:10 
QuestionRe: Fix for bug in unzip with password Pin
wangxuchao1236-Nov-12 14:59
wangxuchao1236-Nov-12 14:59 
AnswerRe: Fix for bug in unzip with password Pin
liuliulyh9-Jul-13 21:26
liuliulyh9-Jul-13 21:26 
AnswerRe: Fix for bug in unzip with password Pin
yariv_eis5-Aug-13 23:09
yariv_eis5-Aug-13 23:09 
AnswerRe: Fix for bug in unzip with password Pin
dc_200014-Aug-13 23:38
dc_200014-Aug-13 23:38 
QuestionNon-english chars in filenames = encoding problem Pin
pribylf10-Sep-12 0:38
pribylf10-Sep-12 0:38 
QuestionBase zlib source code update Pin
Member 71766329-Aug-12 4:31
Member 71766329-Aug-12 4:31 
Questioncode::blocks problem Pin
sajjad heydari7-Aug-12 7:59
sajjad heydari7-Aug-12 7:59 
QuestionGreat piece of code!!! Pin
Member 477029225-Jul-12 4:47
Member 477029225-Jul-12 4:47 
GeneralMy vote of 5 Pin
Member 477029225-Jul-12 4:43
Member 477029225-Jul-12 4:43 
QuestionHow to use this in Code:blocks Pin
Pranay Jaiswal15-Jul-12 3:16
Pranay Jaiswal15-Jul-12 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.