CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2013
    Terlingua, Texas, USA

    IONIC zip lib throwing error.

    Wokring with VS 2005 and VB, I have the following code:
                Using zip As ZipFile = ZipFile.Read(ZipFileName)
                    Dim item As ZipEntry
                    For Each item In zip
                End Using
            Catch ex1 As BadReadException
                PrintLine(BookOrgClass.intBOLog, String.Format("Bad Read: Invalid EPUB ({0})", ZipFileName))
            Catch ex1 As Exception
                Console.Error.WriteLine(String.Format("exception: {0}", ex1.ToString))
            End Try
    Now if it's a good zip, it extracts fine; if not I'm getting various exceptions - normally BadReadException.
    What I don't see here is why, rather than being trapped by the catch I'm getting a program ABEND.
    (( that's ABnormal END or "terminating with an exception" for you youngsters ))

    Anyone see what I obviously don't and how to fix it??

  2. #2
    Join Date
    Jan 2006
    Fox Lake, IL

    Re: IONIC zip lib throwing error.

    Because Windows includes file compression? http://www.codeproject.com/Articles/...-Windows-Shell

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Mar 2013
    Terlingua, Texas, USA

    Re: IONIC zip lib throwing error.

    If you're going to give me more of your nonsense answers, you might want to read into that a bit further and you'll see that "Windows Compression" is a very low level and non-compatible compression. It plays well by itself but not well with anyone else.
    Oddly enough, EPUB files are RAR compressed files which are zip extractable - unless the original file is trashed, in which case no-one extracts it.
    And since you're going to give me answer, want to take a look at the snippet and see what's wrong? Oh, the file under discussion is a trashed file, only part of the header is there (Calibre has put together a few of these) any ideas why the catch doesn't catch it?

  4. #4
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008

    Re: IONIC zip lib throwing error.

    I would suspect that it crashing in the Iconic DLL rather than returning an exception back to your code.
    Always use [code][/code] tags when posting code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.