Home > database >  Pb12 call zlib. DLL uncompress failure
Pb12 call zlib. DLL uncompress failure

Time:09-24

My program originally under the pb9 development, compression decompression were used for many years, recently upgraded to pb12 have decompression failed to return - 3

This lets me scratching his head, ever met and concluded a solution,

CodePudding user response:

Done, pb9 and pb12 single-byte and double byte, I think so,

When I was in compression, the compression in the front of the goal blob respectively to increase the length and the length of the compressed before compression, decompression when need to remove the content:
1. To pb9, length of 4 bytes before compression, compressed length of 4 bytes, also said extract from 9 bytes for compressed content in order to extract,

2. For pb12, length of 8 bytes before compression, compressed length of 8 bytes, also said extract from 17 bytes for compressed content in order to extract,


Have to change a lot of content,

CodePudding user response:

The root cause of the problem found,
Prior to compress and uncompress function called, the target blob variable initialization time using lbl_des=blob (space (ll_DestLen), EncodingANSI!) , pay attention to the encoding is EncodingANSI! Any operation, the BLOB variable to use this code,
Otherwise everything is double,

CodePudding user response:

You should use the new version of zlib zlibwapi. DLL, it doesn't matter,
Relevant code:

//the allocate buffer space
Lul_srclen=Len (ablob_source)
Lul_destlen=(lul_srclen * 1.01) + 12//zlib needs a little extra room
Lblob_dest=Blob (Space (lul_destlen))

//compress the blob
Li_rc=compress (lblob_dest lul_destlen, ablob_source, lul_srclen)

CodePudding user response:

In Windows xp, washed-up, 2 k, vista will do, but not in Windows 7, error reference failure,

Got a big head.
You should use the new version of zlib zlibwapi. DLL, how to use

CodePudding user response:


Done, windowS 7 environment need to zlibwapi. DLL under the windowS \ system32,

Xp just 2 k, etc in the current directory (to set the current before, of course, is to use the DLL path)
  • Related