Xceed Zip Compression Library Documentation
DLL API sample for Visual Basic
Sample applications > Visual Basic > DLL API sample for Visual Basic

You can find the DLL API Sample Application for Visual Basic in:

SAMPLES\VISUAL BASIC 6\DLL API

This sample application provides you with a visual application that lets you perform basic zipping and unzipping. It shows you how to run DLL API methods and set properties. Code is also provided so you can write event handlers using the "callback function" technique (as opposed to using "windows messages").

The methods demonstrated are: XceedZipInitDLL, XceedZipShutdownDLL, XzCreateXceedZipA, XzDestroyXceedZip, XzSetXceedZipWindow, xzZip (Zip method), xzUnzip (Unzip method) and XzGetErrorDescription (GetErrorDescription method).

Various property setting functions such as XzSetZipFilename (sets the ZipFilename property).

To use the sample, load the DLLAPI.VBP project file, then run the program.

The file xcdDllApi.bas contains all the constants and function declarations you will need for using any Xceed Zip DLL API capability or function in your VB projects. Include it in your projects as needed.

Events

To write event handlers, you'll find commented lines indicating "Your code here" at the bottom section of the xcdDllApi.bas file. Place your event handling code there, and don't forget to call the XzSetXceedZipCallBack function, as shown in the code below (copied from the sample application):

Call XzSetXceedZipCallback(hUnzip, AddressOf XceedZipCallbackProc)

In the sample, you can change the constant (shown below) to True so that the code will automatically call the XzSetXceedZipCallBack function when you click the Unzip button. All that's left is to write the handler for the events of your choice (write them in the xcdDllApi.bas file).

#Const TestCallback = False