views:

601

answers:

4

Hi

Is there a way to get documentation(like javadoc) in a visual-c++ project?

I'm using visual studio 2010.

thanks!

+1  A: 

One way to generate documentation is - you guessed it - javadoc. You simply have to comment the same way you usually do, and javadoc does a good job of converting them to HTML/LaTeX style.

Of course, that's not the only solution. I'll leave room for others.

Xavier Ho
Um.. Java and C++ are similar, but they are not that similar. Javadoc is not going to know what to do when it encounters things like templates and such in the source code.
Billy ONeal
@Billy: You can use Javadoc style comments with Doxygen, though.
Jason Williams
+6  A: 

You could use the XML-Documentation format, supported by VS2010, too. http://msdn.microsoft.com/en-us/library/ms177226%28VS.80%29.aspx

After commenting your code, you can use Sandcastle to create a MSDN-like documentation: http://sandcastle.codeplex.com/. (Here is a GUI representation for Sandcastle, which is a lot easier to use: http://shfb.codeplex.com/)

I use AtomineerUtils to create the XML-Documentation headers automatically. This tool will help you a lot. You can have free base version here: http://www.atomineerutils.com/products.php

Simon
+1 -- not only does this produce great looking docs, the compiler will annotate the output with the types and such the comments are attached to and all kinds of other goodies. If you need to fail over to something cross platform, Doxygen can recognize this format as well.
Billy ONeal
+6  A: 

You can have a look at Doxygen.

KTC
+1  A: 

You could use my addin, AtomineerUtils to quickly generate documentation comments in Documentation-XML, doxygen, or JavaDoc format. Then use Sandcastle (DocXml) or Doxygen (DocXml, Doxygen, Javadoc) to convert this documentation into external documentation files.

I'd recommend uing DocXml format because all the above tools work with it, and Visual Studio recognises it (it syntax colours it, and it builds the docs into its intellisense database so it appears in tool-tip help as you type class/method names into your code.

Jason Williams
Thanks for the tip!
Gravitas