home *** CD-ROM | disk | FTP | other *** search
/ Freelog 11 / Freelog011.iso / Bas / Compression / ZLib / contrib / visual-basic.txt < prev   
Text File  |  1998-06-16  |  3KB  |  70 lines

  1. See below some functions declarations for Visual Basic.
  2.  
  3. Frequently Asked Question:
  4.  
  5. Q: Each time I use the compress function I get the -5 error (not enough
  6.    room in the output buffer).
  7.  
  8. A: Make sure that the length of the compressed buffer is passed by
  9.    reference ("as any"), not by value ("as long"). Also check that
  10.    before the call of compress this length is equal to the total size of
  11.    the compressed buffer and not zero.
  12.  
  13.  
  14. From: "Jon Caruana" <jon-net@usa.net>
  15. Subject: Re: How to port zlib declares to vb?
  16. Date: Mon, 28 Oct 1996 18:33:03 -0600
  17.  
  18. Got the answer! (I haven't had time to check this but it's what I got, and
  19. looks correct):
  20.  
  21. He has the following routines working:
  22.         compress
  23.         uncompress
  24.         gzopen
  25.         gzwrite
  26.         gzread
  27.         gzclose
  28.  
  29. Declares follow: (Quoted from Carlos Rios <c_rios@sonda.cl>, in Vb4 form)
  30.  
  31. #If Win16 Then   'Use Win16 calls.
  32. Declare Function compress Lib "ZLIB.DLL" (ByVal compr As
  33.         String, comprLen As Any, ByVal buf As String, ByVal buflen
  34.         As Long) As Integer
  35. Declare Function uncompress Lib "ZLIB.DLL" (ByVal uncompr
  36.         As String, uncomprLen As Any, ByVal compr As String, ByVal
  37.         lcompr As Long) As Integer
  38. Declare Function gzopen Lib "ZLIB.DLL" (ByVal filePath As
  39.         String, ByVal mode As String) As Long
  40. Declare Function gzread Lib "ZLIB.DLL" (ByVal file As
  41.         Long, ByVal uncompr As String, ByVal uncomprLen As Integer)
  42.         As Integer
  43. Declare Function gzwrite Lib "ZLIB.DLL" (ByVal file As
  44.         Long, ByVal uncompr As String, ByVal uncomprLen As Integer)
  45.         As Integer
  46. Declare Function gzclose Lib "ZLIB.DLL" (ByVal file As
  47.         Long) As Integer
  48. #Else
  49. Declare Function compress Lib "ZLIB32.DLL"
  50.         (ByVal compr As String, comprLen As Any, ByVal buf As
  51.         String, ByVal buflen As Long) As Integer
  52. Declare Function uncompress Lib "ZLIB32.DLL"
  53.         (ByVal uncompr As String, uncomprLen As Any, ByVal compr As
  54.         String, ByVal lcompr As Long) As Long
  55. Declare Function gzopen Lib "ZLIB32.DLL"
  56.         (ByVal file As String, ByVal mode As String) As Long
  57. Declare Function gzread Lib "ZLIB32.DLL"
  58.         (ByVal file As Long, ByVal uncompr As String, ByVal
  59.         uncomprLen As Long) As Long
  60. Declare Function gzwrite Lib "ZLIB32.DLL"
  61.         (ByVal file As Long, ByVal uncompr As String, ByVal
  62.         uncomprLen As Long) As Long
  63. Declare Function gzclose Lib "ZLIB32.DLL"
  64.         (ByVal file As Long) As Long
  65. #End If
  66.  
  67. -Jon Caruana
  68. jon-net@usa.net
  69. Microsoft Sitebuilder Network Level 1 Member - HTML Writer's Guild Member
  70.