Click here to Skip to main content
Click here to Skip to main content

Automatic HTMLHelp Documentation for COM type libraries

, 6 Mar 2003
Rate this:
Please Sign up or sign in to vote.
A tool that automatically generates HTMLHelp documentation of COM type libraries. You can then add explanations and example source code for your methods.
<!-- Download Links --> <!-- Article image -->

Sample Image - DocLibTool.jpg

<!-- Add the rest of your HTML here -->

Description

Tool for Documentation of Type Libraries (DocLibTool) is a VB6 program that helps you document Microsoft COM type libraries (and thus any COM component described in a type library) in HTML Help format. It created it while working in a company to help me create the documentation for some large COM objects. Information from the type library is extracted using the functions of the TypeLib Information component implemented in TLBINF32.DLL. Read the MSDN magazine article Visual Basic: Inspect COM Components Using the TypeLib Information Object Library for details about this component.

Basic use of the program is simple. You have to provide a source file containing a type library (*.EXE, *.DLL, *.TLB) created by any COM-enabled language (VC++, VB, Delphi, ...), point to a directory where all output files will be put and then press the "Generate files" button. The program will create a set of  HTML files describing the type library (objects, interfaces, methods, enumerations), an XML file having all this information in a structured way, an HTML Help Project file (.HHP) , a HTML Help Contents file (.HHC), a HTML Help Index file (.HHK). To compile the help file ( .CHM extension) you open HTML Help Project file with the Microsoft's HTMLHelp program and press the "Compile" button. If you don't have the HTMLHelp tool you can freely download it from Microsoft's MSDN site (search for 'HTMLHelp' and you 'll find it).

You can add your own customized information to the help file, by editing the XML file and filling the empty tags that exist for this purpose: CoClassDescription, InterfaceDescription, MemberDescription, ReturnValueDescription, ParameterDescription, ExampleCode, Related, EnumerationDescription. A program has also a visual editor that allows you to easily enter additional information for the methods (general description, parameters/return value descriptions, example source code). The editor saves this information in the XML file. You can also edit the Contents file and the Index file with the Microsoft HTMLHelp tool. Finally, you can also change the format of the HTML files and their structure (more difficult !) by editing the XSL files. When you re-generate the files (due to a change in the type library for example) all the custom information that you have entered in the XML is copied from the old file to the new one. If you have added entries in the contents or the index file they will be retained also. Information for each project is stored in a configuration file with the .dlt extension. The format of the file is the same as the format of INI files. 

Screenshot of the DocLibTool program

How to enhance the tool

Information extracted from the type library is saved in an XML file. XSL transformations (extended with some Microsoft VBscript code) are used to create the output files (HTML,etc.). If you want to improve the documentation that the tool produces, you can edit the following files that are used by it. These files are:

File name

Description

TemplateOfTypeLibInfo.xml Defines the structure of the generated description XML file. Do not edit it unless you can make the necessary changes also to VB code.
TemplateOfTLBParts.XSL This XSL file contains templates for HTML files, for HHC file and for HHK file. You can edit it to customize the appearance of the HTML files.
scripts.xsl Contains VBScript code used to implement tasks beyond the capabilities of the XSL stylesheet commands (for example save an XML fragment in disk). The functions it contains are called by the TemplateOfTLBParts.XSL. Better not modify any of the functions.
ie4.css Styles used in the HTML files

History

  • 13 Jan 2003 - added installation download
  • 7 Mar 2003 - updated installation download

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Philipos Sakellaropoulos
Web Developer
Greece Greece
Software developer and Microsoft Trainer, Athens, Greece (MCT, MCSD.net, MCSE 2003, MCDBA 2000,MCTS, MCITP, MCIPD).
Follow on   Twitter   Google+

Comments and Discussions

 
GeneralVery Good one Pinmemberkrssagar30-Jun-04 18:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 7 Mar 2003
Article Copyright 2002 by Philipos Sakellaropoulos
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid