login about faq


I have the chilkat activex 9.5 with VB6. I need to determine if a file is within a zip file.

I tried the code below but even though it sees that there are 582 files within the zip… when I go to list them… the debug.print values of ssmain2.zentry.FileName are all blank. I did notice that the filedatetime were al; 1/1/1900.

I have defined the chilkatzip and chilkatzipentry controls on a form. What do you think is going wrong? I have tried different things for hours now and about to go nuts.

rcode = ssmain2.czip2.OpenZip(ssmain2.cmdialog1.FileName)

Dim n As Long

'  Get the number of files and directories in the .zip
n = ssmain2.czip2.NumEntries
Debug.Print n

Dim i As Long

For i = 0 To n - 1

set ssmain2.zentry = ssmain2.czip2.GetEntryByIndex(i)

If (ssmain2.zentry.isDirectory = 0) Then

'  (the filename may include a path)

Debug.Print ssmain2.zentry.FileName

End If


asked Jan 29 '17 at 16:10

wxperson99's gravatar image


edited Jan 30 '17 at 10:53

jpbro's gravatar image

jpbro ♦

Check to see if you have a line in your VB6 that is:

On Error Resume Next
If you have it, it's not a good idea for debugging/development as it hides problems.


answered Jan 30 '17 at 09:32

chilkat's gravatar image

chilkat ♦♦

Couple of other things:

  • Have you successfully unlock the ZIP object with an active license key using the UnlockComponent method?
  • Do you have Option Explicit defined at the top of your modules?
  • I would also try without the objects declared on a separate form - keep the ZIP and Entry objects local to your method and try the code with everything in one method. Once you get things working, you can think about breaking it apart as required.

answered Jan 30 '17 at 10:53

jpbro's gravatar image

jpbro ♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



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



Asked: Jan 29 '17 at 16:10

Seen: 1,247 times

Last updated: Jan 30 '17 at 10:53

powered by OSQA