This blog entry is going to be quick because it is going on 4:30 AM at this end. If I don't get some sleep, the shadow people will be coming to take me away! Even though sleep deprivation has become a way of life at this end, I try not to over do it for obvious reasons.
Wash, Rinse, and RepeatI've always thought it would be cool if Visual FoxPro had its own compression functions. The ability to generate Zip-compatible files and unzip said same is one of the things that many developers do in their applications over and over again. In the case of Visual FoxPro, adding compression features has usually been a matter of finding some 3rd party product that provides the needed functionality and then wrapping it using Visual FoxPro classes and/or code.
Half-baked Extended MAPI FLL and ZlibWell, for a few weeks now I've been thinking that I needed to come up with something cool to make up for the lack of blog entries here on the SPS Weblog. I've thrown down some code for another FLL that aims to give VFP'ers Extended MAPI support (I'd like to say goodbye to Outlook Security warnings for VFP applications among other things), but I'm not quite done with that one. Soooooo, given that zlib compression library is freely available, and there are quite a few C++ wrappers out there that work with it (regrettably most are MFC), I thought I would sit down for a few hours and write an FLL that would allow the VFP Community to work with Zip files natively.
Download Link and Sample CodeBefore downloading this FLL please bear in mind the following..
That having been said, here's the download link and a few simple code examples to get you started...
VFPCompression FLL Download (32 KB approx.)
*!* Example 1SET LIBRARY TO LOCFILE("vfpcompression.fll") ?ZipOpen("C:\MyZipFile.zip", "C:\", .F.) ?ZipFile("C:\SomeFile.txt", .F.) *!* could zip other files and folders here before close ?ZipClose()SET LIBRARY TO*!* Example 2SET LIBRARY TO LOCFILE("vfpcompression.fll") ?ZipOpen("C:\MyZipFile.zip", "C:\", .T.) ?ZipFolder("C:\SomeFolder", .F.) *!* could zip other files and folders here before close ?ZipClose()SET LIBRARY TO*!* Example 3SET LIBRARY TO LOCFILE("vfpcompression.fll")?UnzipOpen("C:\MyZipFile.zip")?UnzipTo("C:\")?UnzipClose()SET LIBRARY TO
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u