|
1 members (Russ),
10,950
guests, and
1,516
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
S |
M |
T |
W |
T |
F |
S |
|
|
|
1
|
2
|
3
|
4
|
5
|
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
|
27
|
28
|
29
|
30
|
31
|
|
|
|
|
This is another custom island. This one could be used for ads. This spot is one of the best places for ads on your site to be placed. This can be enabled/disabled on a per forum basis.
|
|
|
|
Joined: Dec 1999
Posts: 30,868
Master Elite Member
|
Public Function UnzipPK_MM(Val() As Byte, Password As String, ZipControl As Zip, ByRef Status() As Variant) As Byte()
'Purpose
' Used to decompress a value and return the result.
'Parameters
' Val (Byte()) = The value we want to decompress.
' Password (String) = A password used to decrypt the value.
' A password is not used to decode the value if it is zero-length.
' ZipControl (Zip) = A reference to the Dart Zip control we're going to use for decompression.
' Status (Variant()) = A standard rtStatus array. This is used to return status information.
' Returned status values are taken directly from the Dart Zip control and DartStream objects.
' Status conditions are reported in the first two elements only. Any additional elements are unchanged.
' This must enter with two or more elements (zero-based) or function may crash.
'Return (Byte())
' Returns the specified value uncompressed.
' If an error occurs, returns an empty Byte array.
'Exit Conditions
' The FileStore object of the specified Zip control is altered.
'Dependencies
' The Dart "Zip" control must be referenced in the hosting application.
'Version History
' 1.0 7/4/2004 Tested by Russ Tanner
'---
'Set status trap
On Error GoTo UnzipPK_MM_Error:
'Initiate variables
Dim StreamIn As New DartStream 'we need 2 separate streams here
Dim StreamOut As New DartStream
Dim EmptyByteArray() As Byte
'Clear the status condition
Status(0) = CLng(0)
Status(1) = ""
'Remove all previous files from the FileStore
ZipControl.FileStore.Clear
'Load the specified value to the FileStore
StreamIn.Write Val
ZipControl.FileStore.Load StreamIn
'Unzip the value. Use a password only if it is specified.
If Password = "" Then
ZipControl.FileStore(1).Extract StreamOut
Else
ZipControl.FileStore(1).Extract StreamOut, Password
End If
'Remove all previous files from the FileStore
ZipControl.FileStore.Clear
'Return the result
StreamOut.Position = 0 'Must rewind the stream to read from it
UnzipPK_MM = StreamOut.ReadBytes 'Return the uncompressed value
Exit Function
'Error Trap
UnzipPK_MM_Error:
'An error occured, return an empty Byte array
UnzipPK_MM = EmptyByteArray
'Remove all previous files from the FileStore
ZipControl.FileStore.Clear
'Return the error information
Status(0) = Err.Number
Status(1) = Err.Description
End Function
|
|
|
|
|