Jump to content

Zip dll


eltorro
 Share

Recommended Posts

Here's a dll that doesn't need a callback and can be used as an object (com).

I converted the examples from the website to autoit. Zbit dll

I extracted the files to a seperate folder within autoit and regeistered the components. Take a look.

;Converted from .asp example    
; http://www.zbitinc.com/product.aspx?p=2
;Sample program using zbit.dll for zip and unzip support in Autoit3
;Requires Beta
;Download and extrat the zip. Execute the bat th register the dll and tlb.

;Main
#include <GUIConstants.au3>

GUICreate("Zbit zip dll test") ; will create a dialog box that when displayed is centered

Opt("GUICoordMode",2)
$zip = GUICtrlCreateButton ("Zip",  10, 30, 50)
$unzip = GUICtrlCreateButton ( "UnZip",10,-1, 50)

GUISetState ()    ; will display an  dialog box with 2 button

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    if $msg =$zip then Zip()
    if $msg =$unzip then unzip()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend


Exit

;Sample use of Zipfile function:
Func Zip()
Dim $sInFiles,$sZipPath,$ret
$sInFiles="C:\~res.txt;C:\boot.ini.bak.txt;C:\hexedit.exe"
$sZipPath="C:\myzip.zip"
$Arch = ObjCreate("Pnvzip.ZipFunctions")
$ret=$Arch.ZipFile($sInFiles,$sZipPath)
$Arch = ""
ConsoleWrite ("response=" & $ret) 
EndFunc

;Sample use of UnzipFile function:
Func Unzip()
Dim $complPath,$unzippedPath,$ret
$complPath="C:\myzip.zip"
$unzippedPath="C:\directory\unzipped\"
$Arch = ObjCreate("Pnvzip.ZipFunctions")
$ret=$Arch.UnzipFile($complPath,$unzippedPath)
$Arch = ""
ConsoleWrite("response=" & $ret)
EndFunc

The only bad things is you have to give them an email, so I gave them my spam account. :dance::whistle:

Cheers.

Link to comment
Share on other sites

I sometimes like spam, usually with eggs and oj. :whistle:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...