Archived Forum Post

Index of archived forum posts

Question:

Zip entry problem

Jan 30 '17 at 10:53

Hi,

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

Next

Answer

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.


Answer

Couple of other things: