第一步:找到文件所在目录,鼠标右键VC++6.0点击打开文件所在的位置
第二步:在此电脑里找到E盘 -->VC6.0-->Microsoft Visual Studio-->Common-->MSDev98-->Macros打开,在此目录里新建文本文档命名为"comment.dsm"并添加以下代码:
Sub CustomCommentOut()
'DESCRIPTION: 注释/取消注释宏,可处理VB和C++、Java注释
Dim win
set win = ActiveWindow
If win.type <> "Text" Then
MsgBox "This macro can only be run when a text editor window is active."
Else
TypeOfFile = 3
If TypeOfFile > 0 And TypeOfFile < 6 Then
If TypeOfFile > 3 Then
CommentType = "'" ' VB注释
CommentWidth = 1
Else
CommentType = "//" ' C++、java 注释
CommentWidth = 2
End If
StartLine = ActiveDocument.Selection.TopLine
EndLine = ActiveDocument.Selection.Botto