Jump to content
Sign in to follow this  

Can DLLCall/DLLStruct be used for unzipping files?

Recommended Posts

Can AutoIt take advantage of Windows XP built-in zip support? I found a VB6 sample (snippet below, full class is attached) but I'm unsure how to rework the code for use with AutoIt. Any ideas?




Public Sub ExtractFile( _
   ByVal Name As String, _
   ByVal DestFolder As String)
Dim oStream As IStream
Dim tStat As STATSTG
Dim abData() As Byte
Dim lFF As Long

   ' Open the stream
   Set oStream = m_oStorage.OpenStream( _
      Name, 0, _
   ' Get the stream info
   oStream.Stat tStat, STATFLAG_DEFAULT
   ' Initialize the array
   ReDim abData(0 To tStat.cbSize * 10000 - 1)
   ' Read the data from the stream
   oStream.Read abData(0), tStat.cbSize * 10000
   ' Close the stream
   Set oStream = Nothing
   ' Save the data to a file
   lFF = FreeFile()
   Open DestFolder & "\" & Name For Binary As lFF
   Put lFF, , abData
   Close lFF
End Sub

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...