0

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?

MPelletier
  • 16,256
  • 15
  • 86
  • 137
themaestro
  • 13,750
  • 20
  • 56
  • 75

3 Answers3

2

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

DumbCoder
  • 5,696
  • 3
  • 29
  • 40
  • 6
    I'm not sure if the username is ironic to coincide with the advice given. – p.campbell Aug 11 '10 at 15:21
  • 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 Aug 11 '10 at 15:25
  • See the "Auto-extend multi-line comments" option on the Advanced | Corrections page of the VA Options dialog. – sean e Aug 17 '10 at 18:15
0

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.

Community
  • 1
  • 1
SethO
  • 2,703
  • 5
  • 28
  • 38
0

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
  • 25,836
  • 3
  • 63
  • 101