Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Method Documentation Utility for Visual C++ 6

0.00/5 (No votes)
26 Mar 2004 1  
Add-in that generate automatic documentation template for C++ methods.

General

Here is another tool to make programmers' life easier. In my article Custom Auto Complete for Visual C++6, I published a tool that does auto completion for code blocks. In this article, I bring you a tool that will place documentation for a method automatically.

This is not a new concept. The Visual Studio .NET supports this feature, but there are people who still work with the Visual C++6 environment (most of whom I know).

Description

The concept is very simple. You define a method in the H/CPP file and you want to document it. Method documentation usually consists of the following parts:

  • Description
  • Parameters description
  • Return value description

Example:

//-----------------------------------------------------------

//

// Description: This method does�

//

// Return Value: bool � The return value is �

//

// Param: nF � This parameter represents �

//

// Param: nS - This parameter represents �

//

bool func(int nF, int nS)

There is a lot of text we should write before we can actually document the method. This add-in is doing it for us. All you have to do is put the cursor one line before the method like this:

[Cursor Here]
bool func(int nF, int nS);

Then press the Add-in button or your selected keyboard shortcut.

The Add-in extracts the method�s text. It starts with the next line after the cursor and collects the text until it reaches �)�. It then parses the text. Currently, I am parsing only the return value and the parameters list. If any need for additional information like: virtual/const will arise, it will be added to the tool.

Using the Add-in

To install the binary and use it under Visual C++ 6, please read the Readme.txt file added in both zip files

The code was tested under Windows2000/XP only and it may work under Windows 98 but who knows for sure�

A Word from Me

I know some of you object the writing in VB. I am publishing ideas that may help you all in your work. The implementation language of the ideas is less important than the ideas themselves. These tools are useful no matter what language they where written with.

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