How to Use XbZLib
Previous  Top  Next

To use the XbZLib.dll in one of your own Xbase++ programs, you only need to do the following:

1.Download and Unzip the latest version of the "XbZLibxx.zip" file, and extract it into your development machine. This zip file includes several directories, as described in the List of included Files. The "xx" in "XbZLibxx.zip" refer to the version number. The current one is XbZlib Version 1.1, and you can download this "XbZLib11.zip" file from Phil Ide's web site at: http://www.idep.org.uk/xbase/datpage/xbzlib.html  
 
2.Then copy the pre-compiled "XbZLib.dll" and the included "ZLib.dll" from the "XbZLib\Lib\" folder into your "..\Alaska\XPPW32\Runtime\" folder. Those two files have to be distributed with your application. If you have made changes to the included "XbZLib.dll" source code or if you use a different Xbase++ Version than 1.82.306, you can compile your own version with the supplied files. Just copy all files from the main "XbZLib" folder and also all files from the "XbZLib\Phil\" folder into the same directory, and then type "PBuild XbZLib" (or something similar, depending on the development environment you like to use, like VX or some other IDE). This will recreate the "XbZLib.dll" as well as the corresponding "XbZLib.lib" file, and the "TestZLib.exe" demo/test program.  
 
3.Then copy both, the "XbZLib.dll" as well as the "XbZLib.lib" file from the "XbZLib\Lib\" folder into your "..\Alaska\XPPW32\Lib\" folder. If you have created your own version of "XbZLib.dll", use that file together with the corresponding, new, "XbZLib.lib" file instead.  
 
4.Then add the following two lines to you "Project.xpj" file (you can add those two files either to the Auto-Depend section or, if you prefer, after the Auto-Depend section):  
·XbZ_Zip.ch  
·XbZLib.lib  
 
That's it!

Now you can use the XbZLibZip() Class and all its Methods as well as the included Support Functions, etc. in your own applications. By adding those two lines to your "Project.xpj" file, both, the "XbZLib.dll" as well as the "ZLib.dll", will be available to your Xbase++ application, and the "XbZLib.dll" will be statically linked to it. As the original "XbZLib.dll" is created with the "\dll:dynamic" flag set, you can also "DllLoad()" and "DllUnload()" it in your application, if you prefer that. The "XbZLib.dll" internally "DllLoad()"s the "ZLib.dll" as well as the "Kernel32.dll" as required. You only need to include the "XbZ_Zip.ch" file in your project, rather than the "XbZLib.ch" file, as this (new header) file includes all the defines that are exposed by the XbZLibZip() Class and its Methods and the included Support Functions.