6

I have just recently been asked to document 10 years worth of VB6 development done by one person. It's been some time since I looked at VB6 code myself, so I'm basically wondering if anyone has any tips for how best to go about it.

Is there any good software, free or not, which would do something similar to javadoc out there for VB6, that could be helpful?

Or just if anyone have any suggestion for tools / methods on how to do this. Any tip would be greatly appreciated.

GSerg
  • 76,472
  • 17
  • 159
  • 346
cc0
  • 1,960
  • 7
  • 40
  • 57
  • I removed `[microsoft.visualbasic]` as it refers to the .NET `Microsoft.VisualBasic` namespace. – GSerg Oct 27 '10 at 11:33
  • Why document and not convert it to VB.NET or C#? VB6 code (documented or not) is unmaintainable in 2010. – Lucas B Oct 27 '10 at 11:34
  • @GSerg - thank you, I didn't realize – cc0 Oct 27 '10 at 12:01
  • @Lucas B - Although I do agree that it's hopelessly old fashioned, it is a fairly large solution in place on a large number of windows servers, and the converting costs would be great. That is the plan eventually, but "not while it still works". – cc0 Oct 27 '10 at 12:06
  • 2
    @Lucas Although there are challenges in maintaining undocumented VB6 code, they are likely to be dwarfed by the challenges of upgrading that VB6 code to .Net without first documenting it or putting it under test. – MarkJ Oct 27 '10 at 12:37
  • Good question. These other questions might be interesting. I don't think yours is an exact duplicate, but they are related. [Best practises for reverse engineering VB6](http://stackoverflow.com/questions/3321448/bestpractice-approaches-for-reverse-engineering-vb6-code-with-out-knowledge-of-th) and [VB6 to UML diagram tool?](http://stackoverflow.com/questions/191287/visual-basic-project-code-to-uml-diagram-tool) and also [tools for understanding VB6](http://stackoverflow.com/questions/1177862/tool-for-analyzing-vb6-source-code-like-understand-from-scitools) – MarkJ Oct 27 '10 at 12:41
  • Also do look at the [VB6 tools and tips](http://stackoverflow.com/questions/664370/your-favorite-visual-basic-6-tools-and-tips). For instance [MZTools](http://www.mztools.com/v3/mztools3.aspx) is a great free tool for navigating round a VB6 project. It has nice tools to do text searches and list all callers to a method. – MarkJ Oct 27 '10 at 12:44
  • Some very good tips in there, thank you for the references! – cc0 Oct 28 '10 at 06:00

4 Answers4

3

You can try VBDox, which is a free VB6 source code documentation generator.

Kelly Ethridge
  • 1,669
  • 1
  • 11
  • 12
  • Will do, thank you for that tip, I was hoping to find something free. – cc0 Oct 28 '10 at 06:04
  • As far as I remember VBDox needs Internet Explorer to display the generated documentation, which I feel is a great drawback. – Christoph Jüngling Jan 16 '19 at 08:48
  • VBDox does use IE to display its contents within the app (including the generated documentation), however, you can change the setting to display the generated documentation in your default browser instead. – Kelly Ethridge Jan 16 '19 at 18:04
1

I used to code in VB6 a loooong time ago, and I never encountered any decent tools that helped with documentation in the Javadoc sense.

I would approach this from the angle of what needs to be documented: is it for developers to understand the API or is it for a user to work with the application? Assuming the former, then what is the bare minimum that you can get away with such that a developer can follow what is going on? You may be able to avoid documenting every method, and just provide a general hand waving use case based approach that could be separate from the code entirely and be based on your explorations. A few good diagrams goes a long way to transferring understanding.

If it is for the user to work the application, then you're into the realms of the help compiler. You might be lucky and find one of this lot is still available: http://help-compiler.qarchive.org/

Alternatively, if it must be the equivalent of Javadocs or you don't get paid, then you may want to consider writing a tool to scan over the source code and do a large portion of the boilerplate parameter filling for you. A tool like Unix AWK can really help here.

Gary
  • 7,167
  • 3
  • 38
  • 57
  • Some good tips here, and food for thought. Thank you. I am thinking I need to write a javadoc similar doc for devs, and then also a few good diagrams for people working with the server structures. Would you happen to have any good diagram writing tips (applications)? I always end up spending a lot of time making it manually. I know that's really another big thread in itself though. – cc0 Oct 27 '10 at 12:46
  • @cc0 In the Microsoft world the king of diagrams is Visio but prepare for open wallet surgery. If you're feeling bold you could look at Graphviz (http://www.graphviz.org/Gallery.php) which allows you to compile diagrams from plain text and is supported directly within the Confluence wiki. Otherwise, you'll need to ask your client what format they'd like the docos in and work to that. – Gary Oct 27 '10 at 13:05
  • great tip, I have never worked with Visio before, but it seems this might be the time to start looking into it, I will also check out the other one, so thank you :] – cc0 Oct 28 '10 at 06:01
1

Our VBdocman does exactly what you need. It uses javaDoc comments and it can generate several output formats.

Peter Macej
  • 4,831
  • 22
  • 49
1

You may find my add-in, Atomineer Pro Documentation helpful. It can generate and update JavaDoc, Qt, Doxygen and Xml-Documentation comments in source code (Visual Basic, C#, C++/CLI, C++, C, Java, unrealscript), and you have a lot of control over the format it produces.

(edit: please note that this addin only works in Visual Studio versions from 2005 onwards, so you cannot use it in VB6, only to document old VB6 code using a newer version of Visual Studio. Once documented however, it can still of course be reloaded and compiled in VB6)

(You could say it generates the "boilerplate" documentation for you, but it generates a lot more than just a basic boilerplate skeleton - it fills in as much detail as possible to minimise the amount of additional documentation you need to write)

So it doesn't create external documentation from the comments (like JavaDoc), it creates the comments themselves - so you would still need another tool to generate the external documentation. However, AtomineerUtils would save a lot of time if you have to generate new documentation comments for existing (undocumented) code, or if you already have the code commented/documented in a Javadoc style, AtomineerUtils can process the documentation comments to convert them to Doxygen or XML Documentation formats, which may help you to gain compatibility with other tools (Sandcastle, etc) that can build external documentation for you.

To generate the external documentation from source-code comments, Doxygen is a leading (and free) external-documentation generation tool that can build documentation from JavaDoc, Qt, Doxygen or Dcoumentation-XML format documentation-comments, and is well worth trying out.

Jason Williams
  • 56,972
  • 11
  • 108
  • 137
  • Excellent, I will try this. I already tried the VBDocman suggested above, but wasn't completely happy with the output. Thank you. – cc0 Oct 28 '10 at 06:04