I have been able to get it to at least load the dll by placing
zlib1.dll (the latest version from http://www.zlib.net) in the same
folder as the project. I was able to call the "version" function of
the zlib module to confirm the right dll was loaded. But I ran into
other troubles with zlib on windows that I have not been able to
resolve. At first it wouldn't even load files to compress. I found
that changing the following line in gzipStream.Constructor.
Change this:
me.gzFile = gzopen(ReplaceAll(f.ShellPath, "\", ""), mode)
to this:
me.gzFile = gzopen(f.AbsolutePath, mode)
However, the gzip archives that it produces don't seem to be valid. I
did some more tinkering on windows. The version of zlib1.dll that I
downloaded came with a few example apps, including minigzip_d.exe,
which I used to compress and decompress a file. I used a textfile
(zlib.h) that came with zlib1.dll for the tests. I made sure
minigzip_d.exe used the same zlib1.dll file as Charles' demo project.
I compressed zlib.h with both minigzip_d.exe and the demo RB project.
Then I uncompressd the two archives with winzip, minigzip_d.exe, and
the demo RB project. I was only able to successfully decompress the
archive created with minigzip_d.exe, and I was only able to do so with
using minigzip_d.exe or winzip to uncompress the archive.
In other words, neither compressing nor uncompressing seem to work.
After looking at both archives with WinHex, I noticed that for every
occurance of 0A (hex) in the file created with minigzip_d.exe, there
is an occurrance of 0D0A in the file created by the demo project. I
replaced all 0D0A with 0A, which made both files identical, and then I
was able to successfully decompress the archive with minigzip and
winzip. So, there seems to be a problem with line endings, at least
for the compression part.
No clue what the problem is in the decompression part. It seems to be
working for the first couple of hundred characters, and then things
appear to be going wrong.
If anyone has been able to make zlib work on windows, I would
appreciate some help with this. I'm stuck.
Post by TomHi List!
I do some zip decompression using Charles zLib module.
The code is
soft declare function zlibuncompress lib zlibPath alias
"uncompress" (dest as Ptr, ByRef destLen as UInt32, source as
CString, sourceLen as Uint32) as Integer
...
pLastErrorCode = zlibuncompress(m, destLength, input, LenB(input))
It works fine on a Mac but on Windows (XP) it does not work due to a
FunctionNotFoundException.
zlibPath on Windows is just "ZLIB1.DLL"
What is the correct zLib path on Windows?
Cheers,
Tom
_______________________________________________
<http://www.realsoftware.com/support/listmanager/>
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>