Login  
Search All Forums
Dart Home | PowerTCP Zip Compression for Active | Custom Development Reply | PowerTCP Zip Compression for ActiveX Topics | Forums   
AuthorForum: PowerTCP Zip Compression for ActiveX
Topic: Runtime Error '91'
User312

From: Andover, United Kingdom
Posts: 41
Member Since: 10/13/00
posted June 25, 2002 9:21 AM

I get the following error when trying to show the progress of the zip.

Runtime Error '91'

Object variable or With block variable not set.

The code I'm using is shown below, and is taken from your sample: -

Private Sub Zip1_Progress(ByVal Status As DartZipCtl.ZipStatusConstants, ByVal File As DartZipCtl.IFile, ByVal FileNumber As Long, ByVal FileBytes As Long, ByVal TotalBytes As Long)

  Dim strStatus As String
  
  strStatus = "Current Operation : "
  
  '* Get current operation and display.
  Select Case Status
    Case zipBeginZip
      strStatus = strStatus & "Beginning Zip Compression for " & File
    Case zipZipping
      strStatus = strStatus & "Compressing Data for " & File
    Case zipEndZip
      strStatus = strStatus & "Finshing Zip Compression for " & File
  End Select
  
  '* Display amount of kilobytes processed for each file.
  strStatus = strStatus & vbCrLf & FileBytes & " uncompressed kilobytes of " & File.Size
  lblOperation.Caption = strStatus
  
  '* Display amount of kilobytes processed for entire collection.
  lblTotal.Caption = "Total Progress " & TotalBytes & " uncompressed kilobytes of " & Zip1.FileStore.TotalBytes

End Sub

The application is in VB and the debug highlights the line: -

strStatus = strStatus & "Beginning Zip Compression for " & File

Where have I gone wrong?

Regards
Jon Belanger



From: Rome, NY USA
Posts: 310
Member Since: 06/10/02
posted June 25, 2002 11:13 AM

Change...

strStatus = strStatus & "Beginning Zip Compression for " & File

  To...

strStatus = strStatus & "Beginning Zip Compression for " & File.Name '<- name property

  File is an object and can't be appended to a string, however it has several properties that can be appended to a string.

J. Belanger

User312

From: Andover, United Kingdom
Posts: 41
Member Since: 10/13/00
posted June 25, 2002 11:18 AM

Thanks for the reply.

I've done that but the same error appears.

Regards
Jon Belanger



From: Rome, NY USA
Posts: 310
Member Since: 06/10/02
posted June 25, 2002 11:54 AM

You can only query the File object at certain points in the unzipping or zipping process. Check for status equal to zipUnzipping or zipZipping to be able to query the file object.

J. Belanger
User312

From: Andover, United Kingdom
Posts: 41
Member Since: 10/13/00
posted June 25, 2002 12:01 PM

The code I'm using is from the Progress Event Example (Zip Control) which was supplied with the tool.

It does check the status with the Select Case statement.

Regards
Jon Belanger



From: Rome, NY USA
Posts: 310
Member Since: 06/10/02
posted June 25, 2002 12:09 PM

You are trying to query the File object when the status is zipBeginZip. The File object will be null at this status point, hence the Object variable not set error. Only query when the file is zipping or unzipping. If you have further problems let me know.

J. Belanger
Reply | PowerTCP Zip Compression for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX