views:

126

answers:

3

I just switched back to c++ after leaving it for awhile and I can't seem to remember how to make nice function/class comment boxes in VS. What I'm looking for is something like this:

/**   
 * Convenience struct: coord
 * -------------------------
 * Simple C++ struct (which is like a class, except there are
 * no methods and everything is public) that bundles two related
 * pieces of data together.
 */

struct coord {
    int row;
    int col;
    };

I don't, however, want to have to format out the nice starring and alignment every time I want to write a new comment. I feel like I used to be able to just type '/**' and then hit return and it would automatically make a comment section for me where every time I hit return a new star would appear aligned with the others. Is there a way to activate this in VS 2010?

+2  A: 

Visual Assist is the tool you require. If you can move away from MSVC IDE, can try Eclipse also.

DumbCoder
What's wrong with Visual Studio? It's brilliant!
nhaa123
I'm not sure if the username is ironic to coincide with the advice given.
p.campbell
I never said it sucks. It is sort of dreary without Visual Assist. And choosing an IDE doesn't make a coder, I presume :)
DumbCoder
See the "Auto-extend multi-line comments" option on the Advanced | Corrections page of the VA Options dialog.
sean e
A: 

Try GhostDoc for a starting point. It is fairly configurable and gives you a documentaion template with one hotkey sequence.

[Edit]

I mistook this for a C# question. As Billy pointed out, GhostDoc is not a good solution for C++ in VS.

Try this SO question about "GhostDoc for C++?" for some other ideas.

SethO
GhostDoc does not support C++.
Billy ONeal
Argh, my mistake Billy. I saw VS2010 and skimmed over the "C++" in the question. I assumed C# incorrectly. Carry on ;)
SethO
A: 

You should be able to record a nice macro to do this, then bind it to an unused button/shortcut key combo and your set, else its pretty trivial to code a simple VS plugin to do this with some extra embelishments

Necrolis