Announcement

Collapse
No announcement yet.

Trouble with PolarZipLight

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trouble with PolarZipLight

    I am trying to use PolarZipLight from Polar Software with PowerBasic. I have used this component for years with Visual Basic without a problem.

    I used the COM browser to create the following code.

    ' Generated by: PowerBASIC COM Browser v.2.00.0058
    ' DateTime : 11/1/2008 at 7:15 PM
    ' ------------------------------------------------
    ' Library Name: POLARZIPLIGHTLib
    ' Library File: C:\Windows\system32\PolarZIPLight.dll
    ' Description : Polar ZIPLight 5.0 ActiveX control
    ' GUID : {9CCD14D6-ABE0-44BF-8F04-29E59D2CEA5E}
    ' LCID : 0
    ' Version : 5.0

    ' Version Dependant ProgID's
    $PROGID_POLARZIPLIGHTLib_ZIPLight5 = "PolarZIPLight.ZIPLight.5"

    ' Version Independant ProgID's
    $PROGID_POLARZIPLIGHTLib_ZIPLight = "PolarZIPLight.ZIPLight"

    ' Class Indentifiers
    $CLSID_POLARZIPLIGHTLib_ZIPLight = GUID$("{1AB22F59-FB66-4A06-BCA9-EA5A6D5785E0}")
    $CLSID_POLARZIPLIGHTLib_Event__IZIPLightEvents = GUID$("{B4B1142C-DAA2-4246-8978-B2733D62FC3A}")

    ' Interface Indentifiers
    $IID_POLARZIPLIGHTLib_Int__IZIPLightEvents = GUID$("{64A53AE7-D599-45FC-A87E-0C403E61F3B3}")
    $IID_POLARZIPLIGHTLib_IZIPLight2 = GUID$("{376F3B90-6939-47DE-82C0-A92F36290A60}")
    $IID_POLARZIPLIGHTLib_IZIPLight = GUID$("{00B2A602-482B-4E39-AF3E-731A11763FF2}")

    ' pzePolarZipErrorConstants enumeration
    %pzeErrorNone = 0
    %pzeUnexpectedEnd = 202
    %pzeErrorGeneric = 203
    %pzeErrorNoMem = 204
    %pzeErrorSevere = 205
    %pzeErrorTooLarge = 206
    %pzeErrorInvalidComment = 207
    %pzeErrorTestFailed = 208
    %pzeErrorTempFile = 210
    %pzeErrorReadSeek = 211
    %pzeErrorNothingToDo = 212
    %pzeErrorMissingZip = 213
    %pzeErrorWriting = 214
    %pzeErrorCreate = 215
    %pzeErrorBadParam = 216
    %pzeErrorOpen = 217
    %pzeErrorNoZip = 218
    %pzeErrorSourceDir = 219
    %pzeErrorTempPath = 220
    %pzeErrorZipPath = 221
    %pzeErrorUnknown = 222
    %pzeErrorUnzipGeneric = 224
    %pzeErrorUnzipSevere = 225
    %pzeErrorUnzipMem = 226
    %pzeErrorUnzipAllocate = 227
    %pzeErrorUnzipMemDecom = 228
    %pzeErrorMemMem = 229
    %pzeErrorZipNotFound = 231
    %pzeErrorInvalidOptions = 232
    %pzeErrorNoMatch = 233
    %pzeErrorDiskFull = 234
    %pzeErrorEndOfArchive = 235
    %pzeErrorUnsupported = 237
    %pzeErrorBadPassword = 238
    %pzeErrorUnzipNoZip = 239
    %pzeErrorNoExtractDir = 240
    %pzeErrorReadSpan = 241
    %pzeErrorReadSpanMem = 242
    %pzeErrorReadSpanUnknown = 243
    %pzeErrorNoSpanDll = 244
    %pzeErrorRemoveSfxStub = 245
    %pzeErrorCreateSfx = 246
    %pzeErrorBrowseForFile = 247
    %pzeErrorSpanNoFiles = 248
    %pzeErrorSpanTooManyFiles = 249
    %pzeErrorSpanCreatingOutput = 250
    %pzeErrorSpanReading = 251


    ' Interface Name : Int__IZIPLightEvents
    ' Description : _IZIPLightEvents Interface
    ' ClassID : $CLSID_POLARZIPLIGHTLib_Event__IZIPLightEvents
    ' ProgID : $PROGID_POLARZIPLIGHTLib_ZIPLight
    ' Version ProgID : $PROGID_POLARZIPLIGHTLib_ZIPLight5
    Class Class_Int__IZIPLightEvents $CLSID_POLARZIPLIGHTLib_Event__IZIPLightEvents As Event
    Interface Int__IZIPLightEvents $IID_POLARZIPLIGHTLib_Int__IZIPLightEvents
    Inherit IDispatch

    Method Error <3> (Byval ErrorCode As Long, Byval ErrorDesc As String)
    ' Insert your code here
    End Method

    Method ProcessStarted <1> ()
    ' Insert your code here
    End Method

    Method ProcessEnded <2> ()
    ' Insert your code here
    End Method

    Method FileStatus <22> (Byval sFilename As String, Byval lSize As Long, Byval lCompressedSize As Long, Byval FilePercent _
    As Double, Byval TotalPercent As Double, Byval bFileCompleted As Integer, ByRef In pAbort As Integer)
    ' Insert your code here
    End Method

    Method FileInfo <10> (Byval sFilename As String, Byval sComment As String, Byval lSize As Long, Byval lCompressedSize As _
    Long, Byval lCompressionRatio As Long, Byval lCrc32 As Long, Byval dtLastModified As Double, Byval bEncrypted As _
    Integer)
    ' Insert your code here
    End Method

    End Interface
    End Class

    ' Interface Name : IZIPLight2
    ' Description : IZIPLight2 Interface
    ' ClassID : $CLSID_POLARZIPLIGHTLib_ZIPLight
    ' ProgID : $PROGID_POLARZIPLIGHTLib_ZIPLight
    ' Version ProgID : $PROGID_POLARZIPLIGHTLib_ZIPLight5
    Interface IZIPLight2 $IID_POLARZIPLIGHTLib_IZIPLight2
    Inherit IDispatch

    Property Set Enabled <-514> (ByVal Rhs As Integer)
    Property Get Enabled <-514> () As Integer
    Method Add <2000> () As Long
    Method Extract <2005> () As Long
    Method List <2028> () As Long
    Method Delete <2030> () As Long
    Property Get AllowErrorReporting <1> () As Integer
    Property Set AllowErrorReporting <1> (ByVal Rhs As Integer)
    Property Get ExtractDirectory <1010> () As String
    Property Set ExtractDirectory <1010> (ByVal Rhs As String)
    Property Get CompressionLevel <1007> () As Long
    Property Set CompressionLevel <1007> (ByVal Rhs As Long)
    Property Get ZipFileName <1016> () As String
    Property Set ZipFileName <1016> (ByVal Rhs As String)
    Property Get Overwrite <1000> () As Integer
    Property Set Overwrite <1000> (ByVal Rhs As Integer)
    Property Get Password <1013> () As String
    Property Set Password <1013> (ByVal Rhs As String)
    Property Get RecurseSubDirectories <1004> () As Integer
    Property Set RecurseSubDirectories <1004> (ByVal Rhs As Integer)
    Property Get FilesToProcess <1115> () As String
    Property Set FilesToProcess <1115> (ByVal Rhs As String)
    Property Get FilesToExclude <1116> () As String
    Property Set FilesToExclude <1116> (ByVal Rhs As String)
    Property Get SourceDirectory <1014> () As String
    Property Set SourceDirectory <1014> (ByVal Rhs As String)
    Property Get UseSpecialWildcards <1033> () As Integer
    Property Set UseSpecialWildcards <1033> (ByVal pVal As Integer)
    End Interface

    ' Interface Name : IZIPLight
    ' Description : IZIPLight Interface
    Interface IZIPLight $IID_POLARZIPLIGHTLib_IZIPLight
    Inherit IDispatch

    Property Set Enabled <-514> (ByVal pbool As Integer)
    Property Get Enabled <-514> () As Integer
    Method Add <2000> () As Long
    Method Extract <2005> () As Long
    Method List <2028> () As Long
    Method Delete <2030> () As Long
    Property Get AllowErrorReporting <1> () As Integer
    Property Set AllowErrorReporting <1> (ByVal pVal As Integer)
    Property Get ExtractDirectory <1010> () As String
    Property Set ExtractDirectory <1010> (ByVal pVal As String)
    Property Get CompressionLevel <1007> () As Long
    Property Set CompressionLevel <1007> (ByVal pVal As Long)
    Property Get ZipFileName <1016> () As String
    Property Set ZipFileName <1016> (ByVal pVal As String)
    Property Get Overwrite <1000> () As Integer
    Property Set Overwrite <1000> (ByVal pVal As Integer)
    Property Get Password <1013> () As String
    Property Set Password <1013> (ByVal pVal As String)
    Property Get RecurseSubDirectories <1004> () As Integer
    Property Set RecurseSubDirectories <1004> (ByVal pVal As Integer)
    Property Get FilesToProcess <1115> () As String
    Property Set FilesToProcess <1115> (ByVal pVal As String)
    Property Get FilesToExclude <1116> () As String
    Property Set FilesToExclude <1116> (ByVal pVal As String)
    Property Get SourceDirectory <1014> () As String
    Property Set SourceDirectory <1014> (ByVal pVal As String)
    End Interface


    I am using the following routine to test using the object.

    SUB TestZip()
    DIM Z AS IDISPATCH
    DIM X AS STRING
    ON ERROR RESUME NEXT
    Z = NEWCOM $PROGID_POLARZIPLIGHTLib_ZIPLight
    IF ISFALSE(ISOBJECT(Z)) THEN
    MSGBOX "error"
    EXIT SUB
    END IF
    X = "C:\temp\test.zip"
    OBJECT LET Z.ZipFileName = X
    X = "*.bas"
    OBJECT LET Z.FilesToProcess = X
    X = "C:\temp"
    OBJECT LET Z.SourceDirectory = X
    OBJECT CALL Z.ADD
    IF ERR THEN ErrorMsg (ERR)
    END SUB

    The routine continues to fail when the ADD method is invoked. Since this object works well with VB with quite similar code, I cannot figure out why it does not work with PowerBasic.

    I am asking Polar Software for help on this but I thought I would see if anyone here has any suggestions.

  • #2
    Note: All Strings must be unicode. UCODE$("MyStringTo Pass")


    James

    Comment


    • #3
      Problem Solved

      That solved the problem. Works fine now.

      Thanks so much.

      Comment


      • #4
        Just because I am a stickler for [ C O D E ] [ / C O D E ] tags (take out the spaces)

        Code:
        ' Generated by: PowerBASIC COM Browser v.2.00.0058
        ' DateTime    : 11/1/2008 at 7:15 PM
        ' ------------------------------------------------
        ' Library Name: POLARZIPLIGHTLib
        ' Library File: C:\Windows\system32\PolarZIPLight.dll
        ' Description : Polar ZIPLight 5.0 ActiveX control
        ' GUID : {9CCD14D6-ABE0-44BF-8F04-29E59D2CEA5E}
        ' LCID : 0
        ' Version : 5.0
        
        ' Version Dependant ProgID's
        $PROGID_POLARZIPLIGHTLib_ZIPLight5 = "PolarZIPLight.ZIPLight.5"
        
        ' Version Independant ProgID's
        $PROGID_POLARZIPLIGHTLib_ZIPLight = "PolarZIPLight.ZIPLight"
        
        ' Class Indentifiers
        $CLSID_POLARZIPLIGHTLib_ZIPLight = GUID$("{1AB22F59-FB66-4A06-BCA9-EA5A6D5785E0}")
        $CLSID_POLARZIPLIGHTLib_Event__IZIPLightEvents = GUID$("{B4B1142C-DAA2-4246-8978-B2733D62FC3A}")
        
        ' Interface Indentifiers
        $IID_POLARZIPLIGHTLib_Int__IZIPLightEvents = GUID$("{64A53AE7-D599-45FC-A87E-0C403E61F3B3}")
        $IID_POLARZIPLIGHTLib_IZIPLight2 = GUID$("{376F3B90-6939-47DE-82C0-A92F36290A60}")
        $IID_POLARZIPLIGHTLib_IZIPLight = GUID$("{00B2A602-482B-4E39-AF3E-731A11763FF2}")
        
        ' pzePolarZipErrorConstants enumeration
        %pzeErrorNone = 0
        %pzeUnexpectedEnd = 202
        %pzeErrorGeneric = 203
        %pzeErrorNoMem = 204
        %pzeErrorSevere = 205
        %pzeErrorTooLarge = 206
        %pzeErrorInvalidComment = 207
        %pzeErrorTestFailed = 208
        %pzeErrorTempFile = 210
        %pzeErrorReadSeek = 211
        %pzeErrorNothingToDo = 212
        %pzeErrorMissingZip = 213
        %pzeErrorWriting = 214
        %pzeErrorCreate = 215
        %pzeErrorBadParam = 216
        %pzeErrorOpen = 217
        %pzeErrorNoZip = 218
        %pzeErrorSourceDir = 219
        %pzeErrorTempPath = 220
        %pzeErrorZipPath = 221
        %pzeErrorUnknown = 222
        %pzeErrorUnzipGeneric = 224
        %pzeErrorUnzipSevere = 225
        %pzeErrorUnzipMem = 226
        %pzeErrorUnzipAllocate = 227
        %pzeErrorUnzipMemDecom = 228
        %pzeErrorMemMem = 229
        %pzeErrorZipNotFound = 231
        %pzeErrorInvalidOptions = 232
        %pzeErrorNoMatch = 233
        %pzeErrorDiskFull = 234
        %pzeErrorEndOfArchive = 235
        %pzeErrorUnsupported = 237
        %pzeErrorBadPassword = 238
        %pzeErrorUnzipNoZip = 239
        %pzeErrorNoExtractDir = 240
        %pzeErrorReadSpan = 241
        %pzeErrorReadSpanMem = 242
        %pzeErrorReadSpanUnknown = 243
        %pzeErrorNoSpanDll = 244
        %pzeErrorRemoveSfxStub = 245
        %pzeErrorCreateSfx = 246
        %pzeErrorBrowseForFile = 247
        %pzeErrorSpanNoFiles = 248
        %pzeErrorSpanTooManyFiles = 249
        %pzeErrorSpanCreatingOutput = 250
        %pzeErrorSpanReading = 251
        
        
        ' Interface Name  : Int__IZIPLightEvents
        ' Description     : _IZIPLightEvents Interface
        ' ClassID         : $CLSID_POLARZIPLIGHTLib_Event__IZIPLightEvents
        ' ProgID          : $PROGID_POLARZIPLIGHTLib_ZIPLight
        ' Version ProgID  : $PROGID_POLARZIPLIGHTLib_ZIPLight5
        Class Class_Int__IZIPLightEvents $CLSID_POLARZIPLIGHTLib_Event__IZIPLightEvents As Event
            Interface Int__IZIPLightEvents $IID_POLARZIPLIGHTLib_Int__IZIPLightEvents 
                Inherit IDispatch
        
                Method Error <3> (Byval ErrorCode As Long, Byval ErrorDesc As String)
                    ' Insert your code here
                End Method
        
                Method ProcessStarted <1> ()
                    ' Insert your code here
                End Method
        
                Method ProcessEnded <2> ()
                    ' Insert your code here
                End Method
        
         Method FileStatus <22> (Byval sFilename As String, Byval lSize As Long, Byval lCompressedSize As Long, Byval FilePercent _
                As Double, Byval TotalPercent As Double, Byval bFileCompleted As Integer, ByRef In pAbort As Integer)
                    ' Insert your code here
                End Method
        
         Method FileInfo <10> (Byval sFilename As String, Byval sComment As String, Byval lSize As Long, Byval lCompressedSize As _
                Long, Byval lCompressionRatio As Long, Byval lCrc32 As Long, Byval dtLastModified As Double, Byval bEncrypted As _
                Integer)
                    ' Insert your code here
                End Method
        
            End Interface
        End Class
        
        ' Interface Name  : IZIPLight2
        ' Description     : IZIPLight2 Interface
        ' ClassID         : $CLSID_POLARZIPLIGHTLib_ZIPLight
        ' ProgID          : $PROGID_POLARZIPLIGHTLib_ZIPLight
        ' Version ProgID  : $PROGID_POLARZIPLIGHTLib_ZIPLight5
        Interface IZIPLight2 $IID_POLARZIPLIGHTLib_IZIPLight2 
            Inherit IDispatch
        
            Property Set Enabled <-514> (ByVal Rhs As Integer)
            Property Get Enabled <-514> () As Integer
            Method Add <2000> () As Long
            Method Extract <2005> () As Long
            Method List <2028> () As Long
            Method Delete <2030> () As Long
            Property Get AllowErrorReporting <1> () As Integer
            Property Set AllowErrorReporting <1> (ByVal Rhs As Integer)
            Property Get ExtractDirectory <1010> () As String
            Property Set ExtractDirectory <1010> (ByVal Rhs As String)
            Property Get CompressionLevel <1007> () As Long
            Property Set CompressionLevel <1007> (ByVal Rhs As Long)
            Property Get ZipFileName <1016> () As String
            Property Set ZipFileName <1016> (ByVal Rhs As String)
            Property Get Overwrite <1000> () As Integer
            Property Set Overwrite <1000> (ByVal Rhs As Integer)
            Property Get Password <1013> () As String
            Property Set Password <1013> (ByVal Rhs As String)
            Property Get RecurseSubDirectories <1004> () As Integer
            Property Set RecurseSubDirectories <1004> (ByVal Rhs As Integer)
            Property Get FilesToProcess <1115> () As String
            Property Set FilesToProcess <1115> (ByVal Rhs As String)
            Property Get FilesToExclude <1116> () As String
            Property Set FilesToExclude <1116> (ByVal Rhs As String)
            Property Get SourceDirectory <1014> () As String
            Property Set SourceDirectory <1014> (ByVal Rhs As String)
            Property Get UseSpecialWildcards <1033> () As Integer
            Property Set UseSpecialWildcards <1033> (ByVal pVal As Integer)
        End Interface
        
        ' Interface Name  : IZIPLight
        ' Description     : IZIPLight Interface
        Interface IZIPLight $IID_POLARZIPLIGHTLib_IZIPLight 
            Inherit IDispatch
        
            Property Set Enabled <-514> (ByVal pbool As Integer)
            Property Get Enabled <-514> () As Integer
            Method Add <2000> () As Long
            Method Extract <2005> () As Long
            Method List <2028> () As Long
            Method Delete <2030> () As Long
            Property Get AllowErrorReporting <1> () As Integer
            Property Set AllowErrorReporting <1> (ByVal pVal As Integer)
            Property Get ExtractDirectory <1010> () As String
            Property Set ExtractDirectory <1010> (ByVal pVal As String)
            Property Get CompressionLevel <1007> () As Long
            Property Set CompressionLevel <1007> (ByVal pVal As Long)
            Property Get ZipFileName <1016> () As String
            Property Set ZipFileName <1016> (ByVal pVal As String)
            Property Get Overwrite <1000> () As Integer
            Property Set Overwrite <1000> (ByVal pVal As Integer)
            Property Get Password <1013> () As String
            Property Set Password <1013> (ByVal pVal As String)
            Property Get RecurseSubDirectories <1004> () As Integer
            Property Set RecurseSubDirectories <1004> (ByVal pVal As Integer)
            Property Get FilesToProcess <1115> () As String
            Property Set FilesToProcess <1115> (ByVal pVal As String)
            Property Get FilesToExclude <1116> () As String
            Property Set FilesToExclude <1116> (ByVal pVal As String)
            Property Get SourceDirectory <1014> () As String
            Property Set SourceDirectory <1014> (ByVal pVal As String)
        End Interface
        
        
        I am using the following routine to test using the object.
        
        SUB TestZip()
            DIM Z AS IDISPATCH
            DIM X AS STRING
            ON ERROR RESUME NEXT
            Z = NEWCOM $PROGID_POLARZIPLIGHTLib_ZIPLight
            IF ISFALSE(ISOBJECT(Z)) THEN
                MSGBOX "error"
                EXIT SUB
            END IF
            X = "C:\temp\test.zip"
            OBJECT LET Z.ZipFileName = X
            X = "*.bas"
            OBJECT LET Z.FilesToProcess = X
            X = "C:\temp"
            OBJECT LET Z.SourceDirectory = X
            OBJECT CALL Z.ADD
            IF ERR THEN ErrorMsg (ERR)
        END SUB
        Helps a lot when we are not the ones that wrote or are familiar with the code
        Engineer's Motto: If it aint broke take it apart and fix it

        "If at 1st you don't succeed... call it version 1.0"

        "Half of Programming is coding"....."The other 90% is DEBUGGING"

        "Document my code????" .... "WHYYY??? do you think they call it CODE? "

        Comment

        Working...
        X