Bueno estoy guiandome de un Tips de Leandro y de la MSDN, pero aun sigo teniendo problemas para comprimir los datos de una variable.
Public Declare Function RtlGetCompressionWorkSpaceSize Lib "NTDLL" (ByVal flags As Integer, WorkSpaceSize As Long, UNKNOWN_PARAMETER As Long) As Long
Public Declare Function RtlCompressBuffer Lib "NTDLL" (ByVal flags As Integer, ByVal BuffUnCompressed As Long, ByVal UnCompSize As Long, ByVal BuffCompressed As Long, ByVal CompBuffSize As Long, ByVal UNKNOWN_PARAMETER As Long, OutputSize As Long, ByVal WorkSpace As Long) As Long
Public Declare Function RtlDecompressBuffer Lib "NTDLL" (ByVal flags As Integer, ByVal BuffUnCompressed As Long, ByVal UnCompSize As Long, ByVal BuffCompressed As Long, ByVal CompBuffSize As Long, OutputSize As Long) As Long
Public Function Compress(Data As String) As String
Dim lenCompress As Long
Dim xWorkSpace As Long
RtlGetCompressionWorkSpaceSize 2, xWorkSpace, 0
RtlCompressBuffer 2, VarPtr(Data), LenB(Data), VarPtr(Compress), LenB(Compress), 4096, lenCompress, xWorkSpace
Debug.Print Len(Compress)
End Function
Que puede ser? x)
PD : Me crashea..
Nadie sabe?