views:

3510

answers:

6

In Visual Studio .NET projects you can add a "Class Diagram" to the project which renders a visual representation of all namespaces, classes, methods, and properties. Is there any way to do this for Win32 (not .NET) C++ projects? Either through Visual Studio itself or with a 3rd party tool?

+2  A: 

Most UML tools should be able to do that. I know that Sparx Systems Enterprise Architect does.

jdisk
A: 

I've got VS2008 SP1 Professional and class diagrams are working fine for C++ WIN32 and Makefile projects.

Jacek Ławrynowicz
A: 

If you're using Visual Studio, class diagrams for C++ were not correctly implemented until Visual Studio 2008.

David Anderson
A: 

Class designer is not meant for C++, even in VS 2008. You will be better off with some more specialized tool. It works for simple projects which don't heavily use templates. Also, get modeling power toys from codeplex.

Try doing partial specializations and watch how it crams everything into a single shape.

Tanveer Badar
A: 

If you have a Visual Studio 2008 solution composed of multiple C++ projects, you can only generate one class diagram per project.

For example, if you have one application project linking to 10 library projects, you'll have to generate 11 separate class diagrams.

There are two ways to work around this, neither of which is pleasant:

  1. Cram all the source into a single project.
  2. Create a class diagram for one project (the application, perhaps) and then drag files from all the other projects into the class diagram.

A more thorough exploration of the capabilities of the Visual Studio class designer is given in Visual C++ Class Designer.

Given the poor support for C++ class diagrams in Visual Studio, you're probably better off going with a commercial tool if you want anything more than a simple list of what classes you have. WinTranslator from Excel Software might be worth looking at, and someone I work with uses Source Insight.

richard.albury
A: 

A cheap way would be to document your source with Doxygen and let this tool create the class diagrams for you.

lothar