Active-X Controls for PalmPilot Doc Conversion etc (Win95/NT Only)

Lots of people have asked about an API and/or command-line interface to MakeDocW. Unfortunately, I'm so busy I often don't even have time to answer such requests - sorry about that.

However, to finally respond to some of these needs and requests, I have recently produced a prototype of a pair of Active-X controls which encapsulate not only the MakeDocW functionality, BUT ALSO conversion back to text format. To complete the set, I have wrapped up the user-data/file-install functionality in a third control.

Please note I really don't have the time to support these controls properly. However, initial testing seems to show that they work OK. If you find any bugs or have any comments/suggestions, then please mail me. However, be aware that I probably won't reply, although I will attempt to fix any bugs etc in future versions.

Licensing

These controls are provided free (and without warranty) for personal non-commercial use only.

Use of the DOX and PalmUser controls for business/commercial purposes, including but not limited to in-house applications, commercially-distributed document conversion and/or preparation systems, or in any application distributed as a component of a commercially-issued software package (including shareware packages) is prohibited unless prior written approval is obtained from the author.

The Controls

Download the DOX and PalmUser Controls (Zipped: 34,164 bytes).

These controls also require the latest MSVCRT.DLL and MFC42.DLL support files - if you don't already have these Microsoft support DLLs on your PC, you can download them here.

Download the MS Visual C++ support DLLs (Zipped: 612,917 bytes).


The DOX and PalmUser Controls are:

Copyright 1996,1997, 1998 Mark Pierce
Compression and .PRC Packing code is Copyright 1996 Pat Beirne
All Rights Reserved


Basic Instructions

You will first need to register the OCXs using regsvr32.exe - if this fails, it means you are either missing some system/support DLLs, or you have out-of-date versions of them. Make sure you download the support files from here. Also make sure you have all the OLE support files from Microsoft.

The DOX.OCX file contains two controls, Compress and Decompress. Note that the conversion (in both directions) is two-stage. First you call the appropriate "ConvertFile( infile, outfile )" method, then you repeatedly call the "DoConversion()" method (eg via a Timer).

"ConvertFile()" returns a negative value to indicate an error. The Compress version returns a positive value for success, which indicates the number of records in the file to be converted. The Decompress version of this function returns zero for success.

If you want to default the output filename, pass an empty string (""), not a null pointer - DOX will use the input filename and the default output extension to create the output file.

If "ConvertFile()" succeeds, you must then call "DoConversion()" repeatedly until the process is complete.

"DoConversion()" returns 0 to indicate successful completion of the conversion, a negative value for an error, and a positive value during the conversion (which indicates the DOC record number currently being converted). This allows you to show a status bar/message for conversion progress. "DoConversion()" converts one record per call.


FAQ

Q. What do the return values from the ConvertFile() methods mean?
A. A negative value indicates a file error (bad filename etc), zero (for decompression) means success, a positive value when converting to DOC format indicates the number of DOC records in the file being converted.

Q. What are the meanings of the CRTreatment possible values?
A. 0 - Strip CRs out completely, 1 - Translate CRs to LFs.

Q. Why a two-stage conversion? Why can't I just call one method and be done with?
A. This approach lets you control the UI aspects better from VB. Every time you call "DoConversion()", it converts a single record, so for example you could choose to convert 5 or (say) 10 records on each timer event, just by calling the method repeatedly.
You can put the "DoConversion()" call in a tight while loop if you prefer, which will give you maximum conversion speed, but no UI response in the meantime, which is probably bad if you're converting a big file. Or you can use a while loop and call "DoEvents()", which I personally don't like (there can be problems with re-entrancy and resource contention in any non-trivial program that does this).

Q. Should I use the auto-install feature of DOX, or is it better to write my app to use PalmUser for installation of files onto the Palm unit?
A. Use PalmUser. The Auto-Install and users features of DOX will probably disappear in the next release.