Click here to Skip to main content
6,635,160 members and growing! (16,468 online)
Email Password   helpLost your password?
General Programming » WinHelp / HTMLHelp » General     Intermediate

Automatic HTMLHelp Documentation for COM type libraries

By Philipos Sakellaropoulos

A tool that automatically generates HTMLHelp documentation of COM type libraries. You can then add explanations and example source code for your methods.
C++, VB 6Win2K, WinXP, Dev
Posted:7 Dec 2002
Updated:6 Mar 2003
Views:93,731
Bookmarked:41 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
22 votes for this article.
Popularity: 6.11 Rating: 4.55 out of 5
1 vote, 4.5%
1

2

3
5 votes, 22.7%
4
16 votes, 72.7%
5

Sample Image - DocLibTool.jpg

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Philipos Sakellaropoulos


Member
Software developer and Microsoft Trainer from Patras, Greece (MCT, MCSD .net, MCSE 2003, MCDBA 2000,MCTS,MCITP,MCIPD). Visit my software page at here
Occupation: Web Developer
Location: Greece Greece

Other popular WinHelp / HTMLHelp articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 27 (Total in Forum: 27) (Refresh)FirstPrevNext
Generaledit xsl Pinmemberstefan002983:15 11 Aug '05  
General_THE_ tool I was lookin' for PinmemberMr. Bit22:36 26 Oct '04  
GeneralRe: _THE_ tool I was lookin' for PinmemberPhilipos Sakellaropoulos4:20 27 Oct '04  
GeneralRe: _THE_ tool I was lookin' for PinmemberMr. Bit8:15 27 Oct '04  
GeneralVery Good one Pinmemberkrssagar19:15 30 Jun '04  
GeneralDocedit error PinsussAnonymous3:47 26 May '04  
GeneralBug when a PinsussSébastien FOUCAULT1:04 20 May '03  
GeneralRe: Bug when a PinsussAnonymous1:44 20 May '03  
GeneralNice... PinmemberRobert Edward Caldecott2:04 11 Apr '03  
GeneralRe: Nice... Pinmembersaltynuts20026:42 4 Mar '04  
GeneralError PinmemberRanael4:12 6 Mar '03  
GeneralRe: Error PinmemberNiw2:48 13 Mar '03  
GeneralError Pinmemberrmorgese4:48 25 Feb '03  
GeneralError "File not found" PinmemberHolger Persch21:04 20 Jan '03  
GeneralRe: Error "File not found" PinmemberPhilipos Sakellaropoulos9:18 7 Mar '03  
GeneralACtiveX can't create object error despite MSXML4 installed Pinmemberpaul ghezzi6:20 18 Dec '02  
GeneralRe: ACtiveX can't create object error despite MSXML4 installed PinmemberPhilipos Sakellaropoulos6:30 18 Dec '02  
GeneralError Message Pinmembersikanderrafiq20:14 15 Dec '02  
GeneralRe: Error Message PinmemberPhilipos Sakellaropoulos13:04 16 Dec '02  
GeneralRe: Error Message Pinmemberpaul ghezzi3:00 17 Dec '02  
GeneralSuggestion PinmemberGiles7:39 10 Dec '02  
Generalmissing OCX PinmemberPhil Sidari12:43 9 Dec '02  
GeneralRe: missing OCX PinmemberPhilipos Sakellaropoulos8:37 15 Dec '02  
GeneralOutstanding! (but...) Pinmembersnakeware7:01 9 Dec '02  
GeneralRe: Outstanding! (but...) Pinmembersnakeware8:46 9 Dec '02  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 6 Mar 2003
Editor: Chris Maunder
Copyright 2002 by Philipos Sakellaropoulos
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project