使用下面代码运行到红色字体报错:ByteArray 类型不匹配。
谁能提供 GZip 关于 compress 函数的详细参数说明,谢谢
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
Private Declare Function InitCompression Lib "gzip.dll" () As Long
Private Declare Function CreateCompression Lib "gzip.dll" (ByRef context As Long, ByVal flags As Long) As Long
Private Declare Function DestroyCompression Lib "gzip.dll" (ByRef context As Long) As Long
Private Declare Function Compress Lib "gzip.dll" (ByVal context As Long, ByVal inBytes As Any, ByVal input_size As Long, ByVal outBytes As Long, ByVal output_size As Long, ByRef input_used As Long, ByRef output_used As Long, ByVal compressionLevel As Long) As Long
Private Const GZIP_LVL As Integer = 1
Public Function GZipCompress(ByteArray() As Byte) As Boolean
Dim hContext As Long '正文句柄
Dim output_used As Long '压缩后尺寸
Dim input_used As Long '未压缩尺寸
Dim buffer() As Byte
context = 0
output_used = 0
input_used = 0
InitCompression ' // 初始化压缩
CreateCompression hContext, GZIP_LVL
ReDim buffer(UBound(In_bytes))
If (Compress(hContext, ByteArray, UBound(ByteArray), buffer, UBound(buttfer), input_used, output_used, GZIP_LVL) <> 0) Then
GZipCompress=false
exit function
End If
GZipCompress=true
end function