Click here to Skip to main content
11,578,954 members (65,846 online)
Click here to Skip to main content

Automatic HTMLHelp Documentation for COM type libraries

, 6 Mar 2003 CPOL 125K 3K 55
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)

Share

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).

You may also be interested in...

Comments and Discussions

 
QuestionRun-time error 429 Pin
Roberto Federiconi17-May-13 6:43
memberRoberto Federiconi17-May-13 6:43 
Generaledit xsl Pin
stefan0029811-Aug-05 2:15
memberstefan0029811-Aug-05 2:15 
General_THE_ tool I was lookin' for Pin
Mr. Bit26-Oct-04 21:36
memberMr. Bit26-Oct-04 21:36 
GeneralRe: _THE_ tool I was lookin' for Pin
Philipos Sakellaropoulos27-Oct-04 3:20
memberPhilipos Sakellaropoulos27-Oct-04 3:20 
GeneralRe: _THE_ tool I was lookin' for Pin
Mr. Bit27-Oct-04 7:15
memberMr. Bit27-Oct-04 7:15 
GeneralVery Good one Pin
krssagar30-Jun-04 18:15
memberkrssagar30-Jun-04 18:15 
Very Nice tool ..Good job
Thank you very much ..

Could you pls tell how can i generate the documentation in C++/VC++ format ?
The documents generated by this tool in VB Syntax .

All suggestions are welcome ...

Thanx in advance
GeneralDocedit error Pin
Anonymous26-May-04 2:47
sussAnonymous26-May-04 2:47 
GeneralBug when a Pin
Sébastien FOUCAULT20-May-03 0:04
sussSébastien FOUCAULT20-May-03 0:04 
GeneralRe: Bug when a Pin
Anonymous20-May-03 0:44
sussAnonymous20-May-03 0:44 
GeneralNice... Pin
Robert Edward Caldecott11-Apr-03 1:04
memberRobert Edward Caldecott11-Apr-03 1:04 
GeneralRe: Nice... Pin
saltynuts20024-Mar-04 5:42
membersaltynuts20024-Mar-04 5:42 
GeneralError Pin
Ranael6-Mar-03 3:12
memberRanael6-Mar-03 3:12 
GeneralRe: Error Pin
Niw13-Mar-03 1:48
memberNiw13-Mar-03 1:48 
GeneralError Pin
rmorgese25-Feb-03 3:48
memberrmorgese25-Feb-03 3:48 
GeneralError "File not found" Pin
Holger Persch20-Jan-03 20:04
memberHolger Persch20-Jan-03 20:04 
GeneralRe: Error "File not found" Pin
Philipos Sakellaropoulos7-Mar-03 8:18
memberPhilipos Sakellaropoulos7-Mar-03 8:18 
GeneralACtiveX can't create object error despite MSXML4 installed Pin
paul ghezzi18-Dec-02 5:20
memberpaul ghezzi18-Dec-02 5:20 
GeneralRe: ACtiveX can't create object error despite MSXML4 installed Pin
Philipos Sakellaropoulos18-Dec-02 5:30
memberPhilipos Sakellaropoulos18-Dec-02 5:30 
GeneralError Message Pin
sikanderrafiq15-Dec-02 19:14
membersikanderrafiq15-Dec-02 19:14 
GeneralRe: Error Message Pin
Philipos Sakellaropoulos16-Dec-02 12:04
memberPhilipos Sakellaropoulos16-Dec-02 12:04 
GeneralRe: Error Message Pin
paul ghezzi17-Dec-02 2:00
memberpaul ghezzi17-Dec-02 2:00 
GeneralSuggestion Pin
Giles10-Dec-02 6:39
memberGiles10-Dec-02 6:39 
Generalmissing OCX Pin
Phil Sidari9-Dec-02 11:43
memberPhil Sidari9-Dec-02 11:43 
GeneralRe: missing OCX Pin
Philipos Sakellaropoulos15-Dec-02 7:37
memberPhilipos Sakellaropoulos15-Dec-02 7:37 
GeneralOutstanding! (but...) Pin
snakeware9-Dec-02 6:01
membersnakeware9-Dec-02 6:01 
GeneralRe: Outstanding! (but...) Pin
snakeware9-Dec-02 7:46
membersnakeware9-Dec-02 7:46 
GeneralRe: Outstanding! (but...) Pin
Philipos Sakellaropoulos16-Dec-02 12:13
memberPhilipos Sakellaropoulos16-Dec-02 12:13 
QuestionWhat a good idea. Pin
Giles8-Dec-02 12:10
memberGiles8-Dec-02 12:10 

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 | Terms of Use | Mobile
Web03 | 2.8.150603.1 | Last Updated 7 Mar 2003
Article Copyright 2002 by Philipos Sakellaropoulos
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid