Posted by: roup21 | October 31, 2008

Active X

     Download the ActiveX Documenter (single EXE, VB runtime and TLBINF32.DLL dependency only) (106kb). Download the ActiveX Documenter source code (157kb). Before you Begin The source code version of project requires the SSubTmr.DLL  component. Make sure you have loaded and registered this before trying the project. 

      This VB application uses TLBINF32.DLL (the one used by VB’s object browser) to investigate the interfaces of compiled ActiveX documents. It  acts as a complement to the object browser in VB, allowing you to look at object interfaces without needing to run VB or to add a reference to the      object. In addition, it produces well formated documentation for an object.

        This release allows you to:  Quickly browse an ActiveX object’s members, Copy the member definitions as fully formatted VB code to your own application, Creates a Rich Text documentation using the procedure attributes built into the ActiveX object’s Type Lib. This is a must download if you’re trying to create help files for your ActiveX objects. The next release (due in August) will be even more  powerful – you’ll be able to create Superclasses of existing ActiveX  objects, choosing where you want to delegate interfaces, and it will generate fully hyperlinked HTML documentation. View a sample RTF document created by the program (7kb). This document was  created for the Common Controls Replacement Project Browse For Folder control. 

 Installation Instructions
      There are no special requirements for installing the executable, just that you have TLBINF32.DLL and the Visual Basic runtimes installed. TLBINF32.DLL is shipped with Visual Basic 5 itself, and I do not think that there is any redistribution agreement for it, so it is not available  on this site. Please tell me if I am wrong! I have only tested the application with COMCTL32.DLL v4.72 and v5.00.05, but it should run just as happily with the one shipped with VB5. If you want the latest version but don’t currently have it, you can either download IE4/IE5 or get it here. 

      About the Code
      There’s quite a lot of source code for this project. It contains implementations of the following controls in VB:
        Common Controls Toolbar
        Common Controls Rebar
        Common Controls Tab Strip
        Common Controls Tooltip
        Rich Edit control (either version 1 or version 2)
      In addition, it uses my classes for registry access, creating Most  Recently Used (MRU) file lists and Common Dialogs. If you’re just interested in how to use TLBINF32.DLL, you will find all the code used to do it in the main form of the application. Be warned, however, there is no documentation supplied for TLBINF32.DLL so the methods I have used to get the information out were based largely on trial and error and reading the information supplied for the members in the object browser.

      Click here for documentation of TLBINF32.DLL created by ActiveX Documenter! (52kb)

      As a consequence, the code may not always take the most ‘elegant’ route (I had a code review with myself, luckily we agreed that the code was   perfectly functional and therefore any shortcuts were entirely justified in the limited development time ;-) However, it does work well with VB libraries. There seem to be two ways of using the TLBINF32.DLL, the first being to iterate through the collections to get the information (the method I used) and the second to install a callback to automatically populate listboxes and combo boxes just like in the Object Browser. I  wanted to iterate through the collections so I had the most control over formatting of the final object, but I think using the callback methods  might result in considerably neater code. I found there was quite a lot of     work involved in converted the raw results returned by the collections to get it into something like what you see in the Object Browser. For  example, consider a VB ActiveX control called cUpDown. The COM object  which is created for it looks something like this: 

           cUpDown   (CoClass)  This contains no members but is the interface you normally access  through VB.
        _cUpDown   (Class)
        This interface contains the methods and properties for the control.
        __cUpDown   (IDispInterface)
        This interface contains the events for the control.
      I found that I had to do the work manually to tie these together to get  the whole picture for a control we’re used to seeing. I think that the callback methods automatically sort out this type of formatting. 

      Anyway, I hope this is of some use to you. It has been for me – I completed all my class documentation for a large VB project at work in  about 5 minutes with it!  Suggestions, Features, Bug Reports etc  Do you have any suggestions for new features or issues with this code? Is  this application of value to you? Please Email me. I’d be very interested  to know.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.