First, add a reference to Chilkat Gzip in your VB6 project…
Dim gz As New Gzip
gz.UnlockComponent "30-day trial" ‘ You can use your Chilkat Zip unlock code here…
fname = "myData.dat"
‘ file-to-file compression…
gz.CompressFile fname, fname & ".gz"
‘ file-to-file uncompress
gz.UncompressFile fname & ".gz", "u.dat"
‘ file-to-memory compression
Dim compressedData as Variant
compressedData = gz.CompressFileToMem(fname)
‘ memory-to-memory uncompress
Dim uncompressedData as Variant
uncompressedData = gz.UncompressMemory(compressedData)
‘ memory-to-file uncompress
gz.UncompressMemToFile compressedData, fname
‘ memory-to-file compress
gz.CompressMemToFile uncompressedData, "myData.dat.gz"
‘ file-to-memory uncompress
uncompressedData = gz.UncompressFileToMem("myData.dat.gz")