themaestro
themaestro

Reputation: 14256

How to Make a Nice Block of Commenting in Visual Studio

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?

Upvotes: 0

Views: 1706

Answers (3)

SethO
SethO

Reputation: 2791

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.

Upvotes: 0

Necrolis
Necrolis

Reputation: 26181

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

Upvotes: 0

DumbCoder
DumbCoder

Reputation: 5766

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

Upvotes: 2

Related Questions