0

I'd like to know if it is possible to insert automatically a comment on C++ code with visual studio that will contain a default id and if possible the current date.
I've found CppTripleSlash from here https://marketplace.visualstudio.com/items?itemName=tcbhat.CppTripleSlash-xmldoccommentsforc, but I'm not interested in xml documentation comment but only inline comment generation.
I assume that this can be achieved through macros and I came across this post In visual studio, how can I write a macro that will insert the date into a comment? which is applicable in C#. Can this be done for C++ as well ?

Community
  • 1
  • 1
dk13
  • 1,461
  • 4
  • 20
  • 47
  • 1
    See http://stackoverflow.com/questions/38260751/keyboard-shortcut-customizing-in-visual-studio-2013 – Sergey Vlasov Mar 14 '17 at 04:17
  • @Sergey Vlasov. It worked great. Thanks a lot. The only thing is when I tried to map the command to a keyboard, in tools -> options -> environment and chose the VCmd.Command01 the field "Shortcuts for selected command" was inactive and could finish the mapping. – dk13 Mar 14 '17 at 08:37
  • "Shortcuts for selected command" shows already assigned shortcuts for the command. To add a new shortcut, select "Use new shortcut in" context, press a desired key combination in the "Press shortcut keys" box, click "Assign", click OK. – Sergey Vlasov Mar 14 '17 at 11:21
  • @Sergey Vlasov. Great thanks a lot. One last thing in order to remove the inserted comment lines should I create an additional command or is there another way? – dk13 Mar 14 '17 at 12:10
  • You can write an additional command to find beginning of a comment and then delete to line end, but probably easier is just to delete it by hand. – Sergey Vlasov Mar 14 '17 at 16:57

0 Answers0