Contents


  1. Contents
  2. Installation
    1. Quick Installation
    2. Manually Registering the Automation Server
    3. Unregistering the Automation Server
  3. Files
    1. Included Files
    2. Distribution
  4. Programming
    1. Converting Between Files
    2. Conversion Formats
    3. Converting Between Strings
  5. The Old Interface
    1. Converting Between Files
    2. Converting Between Strings
  6. Alternative


Installation

Quick Installation

1. The installer should register the server.
2. You should then import the library into your programming environment.

Windows NT/2000 users: Security in Windows NT/2000 is often set up to prevent registering or access to ActiveX DLLs. If you are having problems try running in administrator or root mode.



Manually Registering the Automation Server

1. If you have an old server with the name "doxcom.exe" delete all traces of it. If windows says that it may impact on registered programmes answer 'Yes' to delete it.
2. Unzip the new server to a directory.
3. To register manually open an MSDOS box type  regsvr32 doxcom.dll  
(You may have to include the full path of the file e.g. c:\apps\dox\doxcom.dll)
4. You should now be able to select the library. In visual basic:
Projects->References or select DoxCom.tlb from Projects->References->Browse.



Unregistering the Automation Server

1. Type  regsvr32 /u doxcom.dll  (You may have to include the full path of the file e.g. c:\apps\dox\doxcom.dll)
2. You can now delete doxcom.dll



Files

Included Files

Included files:
DoxCom.dll
Automation server
DoxCom.tlb
Type library
Host.exe
Sample automation client / controller
vb\
Sample visual basic source
bcb3\
Sample Borland C++ Builder 3 source


Distribution

1. Distribute doxcom.dll
2. Register doxcom.dll.
3. Unregister doxcom.dll when uninstalling.
4. Delete doxcom.dll when uninstalling.

The free  NSIS installer can handle all these steps. This product is free for all purposes, including commerical projects. It was created by the makers of Winamp.





Programming

The ActiveX DLL contains two interfaces for accessing the library:
The new interface is designed to be compatible with languages such as Foxpro which can only accept BSTR in ActiveX components. The component keeps the old interface for source and binary compatibility with all versions of Dox / DocFrac.

Converting Between Files

It has three main functions:

The first two must be called before the last one.

For example in visual basic:

dim x as new DocFracLib
x.SetInFileName("resume.rtf")
x.SetOutFileName("resume.html")
x.Convert




Notes:
  1. The default conversion is from rtf to html.
  2. If you wish to use multiple threads you must access the library through the dispatch interface. Not through the dual/vtable interface.

Conversion Formats

The default conversion is from rtf to html. The following functions override the default:

To override the default conversion pass a string to SetInFormat or SetOutFormat:
"rtf"
Rtf format
"htm" or "html"
Html format
"txt"
Text format
"auto"
Guess from the extensions of the filenames. If that is not possible default to RTF to HTML.


If SetInFormat() is not called it will assume you wish to convert from rtf.
If SetOutFormat() is not called it will assume you wish to convert to html.


For example in visual basic:

dim x as new DocFracLib
x.SetInFileName("abcde.tmp")
x.SetInFormat("html")
x.SetOutFileName("fghijk.tmp")
x.SetOutFormat("text")
x.Convert()



Converting Between Strings


Simply use SetInString(InputString) to set the input string you wish to use and
OutputString = StringConvert() to convert and receive the output in a string.

For example in visual basic:
dim x as new DocFracLib
x.SetInString(Temp)
Result = x.StringConvert()


You need not use these functions together. For example in visual basic:

dim x as new DocFracLib
x.SetInString(Temp)
x.SetOutFile("Save.html")
x.StringConvert()

Note:
  1. The "auto" format has no meaning for string conversion. Using "auto" defaults to "rtf" for input format and "html" for output format.





The Old Interface


Converting Between Files

It has three main functions:
SetInFileName(LPSTR FileName)
SetOutFileName(LPSTR FileName)
Convert()

The first two must be called before the last one. The default conversion is from rtf to html.

Note: If you wish to use multiple threads you *must* access the library through the dispatch interface NOT through the dual/vtable interface.

SetInFormat(LPSTR Extension)
SetOutFormat(LPSTR Extension)

To override the default conversion pass a string to SetInFormat or SetOutFormat:
"rtf"
Rtf format
"htm" or "html"
Html format
"txt"
Text format
"auto"
Guess from the extensions of the filenames


"rtf"            Rtf format
"htm" or "html"  Html format
"txt"            Text format
"auto"           Figure it out from the extensions of the filenames (set by SetInFileName and SetOutFileName).

If SetInFormat() is not called it will assume you wish to convert from rtf.
If SetOutFormat() is not called it will assume you wish to convert to html.

Converting Between Strings

SetInString(LPSTR In)
BSTR StringConvert()

Simply use SetInString(InputString) to set the input string you wish to use and
OutputString = StringConvert() to convert and receive the output in a string.

You need not use these functions together. For example in MSVB:
dim x as new DoxLib
x.SetInString(Temp)
x.SetOutFile("Save.html")
x.Convert()





Alternative

If you are using MSVC or BCB you may wish to use the traditional DLL included
in this package


Acronyms:
MSVC    Microsoft Visual C++
MSVB    Microsoft Visual Basic
BCB     Borland C++ Builder
Delphi  Borland Delphi

Website:
http://docfrac.sourceforge.net/
Contact:
andrewpunch@bigfoot.com