找到VC++6.0的安装路径下的 Microsoft Visual Studio 6.0\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.BottomLine
If EndLine < StartLine Then
Temp = StartLine
StartLine = EndLine
EndLine = Temp
End If
' 单行
If EndLine = StartLine Then
ActiveDocument.Selection.StartOfLine dsFirstColumn
ActiveDocument.Selection.CharRight dsExtend, CommentWidth
If ActiveDocument.Selection = CommentType Then
ActiveDocument.Selection.Delete
Else
ActiveDocument.Selection.StartOfLine dsFirstText
ActiveDocument.Selection.CharRight dsExtend, CommentWidth
If ActiveDocument.Selection = CommentType Then
ActiveDocument.Selection.CharRight dsExtend
ActiveDocument.Selection.Delete
Else
ActiveDocument.Selection.StartOfLine dsFirstText
ActiveDocument.Selection = CommentType + vbTab + _
ActiveDocument.Selection
End If
End If
' 多行
Else
For i = StartLine To EndLine
ActiveDocument.Selection.GoToLine i
CommentLoc = dsFirstColumn
ActiveDocument.Selection.StartOfLine CommentLoc
ActiveDocument.Selection.CharRight dsExtend, CommentWidth
If ActiveDocument.Selection = CommentType Then
ActiveDocument.Selection.Delete
Else
ActiveDocument.Selection.StartOfLine CommentLoc
ActiveDocument.Selection = CommentType + _
ActiveDocument.Selection
End If
Next
End If
Else
MsgBox("Unable to comment out the highlighted text" + vbLf + _
"because the file type was unrecognized." + vbLf + _
"If the file has not yet been saved, " + vbLf + _
"please save it and try again.")
End If
End If
End Sub
此时打开VC++6.0窗口,以下步骤:
1.打开菜单栏"Tools" -> "Customize" 打开了"Customize"对话框。
2.
3.
4.在代码中,只需要选中代码或者在光标所在行,执行快捷键"Ctrl + /",进行注释或取消注释。
文章出处:http://blog.csdn.net/gzshun/article/details/7782458
相关推荐
VC++6.0快捷键大全 为VC++6.0快捷键大全.txt 方便参阅
VC++6.0的全部默认快捷键,很详细,有中文说明。
在用VC++6.0调试程序时你是不是还在不断的点击鼠标,这样不但影响速度、效率,还会显得不专业奥,这本快捷键大全能帮助你快速了解VC++6.0的各种快捷键,成为伪高手的必经之路!
vc++6.0快捷键 matlab快捷键
VC++6.0简体中文版本,支持win7提示兼容问题忽略就行。 此前装过别的版本,但win7大多装不上,有的能装上但过程太繁琐。 别的版本有几百兆,而这只有30来兆,而且可直接安装运行,对于专业人士来说此版本功能过于简单...
编者 求是科技 王正军 《VC++6.0从入门到精通》源码,
使用VC++6.0,编写的MFC程序,实现正弦曲线的绘制,包括横纵坐标轴的绘制。
可以在win7上使用的VC++6.0,包含英文版
vc++6.0下开发的仓库管理系统,采用ADO操作数据库,使用数据库为ACCE-vc 6.0's warehouse management system using ADO operational database, using the database to ACCE
VC++6.0中文简体版下载,支持win7。此前装过别的版本,但win7大多装不上,有的能装上但过程太繁琐,此外别的版本有几百兆,下载费时费力,而这只有30几兆,而且可直接安装运行,对于专业人士来说此版本功能可能过于...
Win32环境下基于VC++6.0串口通信编程方法
VC++ 6.0 音乐播放器VC++ 6.0 音乐播放器VC++ 6.0 音乐播放器VC++ 6.0 音乐播放器VC++ 6.0 音乐播放器
免费vc++6.0安装包程序(majin)免费vc++6.0安装包程序(majin)免费vc++6.0安装包程序(majin)免费vc++6.0安装包程序(majin)免费vc++6.0安装包程序(majin)免费vc++6.0安装包程序(majin)免费vc++6.0安装包...
用VC++6.0打开工程文件dsw即可查看和编译代码。。。。。。
在学习过程中用VC++制作的一款游戏,可以和手机游戏媲美,有很高的参考价值
VC++6.0使用方法(精品简约).doc VC++6.0使用方法(精品简约).doc VC++6.0使用方法(精品简约).doc VC++6.0使用方法(精品简约).doc VC++6.0使用方法(精品简约).doc VC++6.0使用方法(精品简约).doc VC++6.0使用方法(精品...
VC++6.0 基于MFC的windows资源管理器风格单文档应用程序 学生管理系统实现增删改查学生信息
windows 32位 vc++ 6.0 sp6补丁包
c++课程设计vc++6.0c++课程设计vc++6.0c++课程设计vc++6.0c++课程设计vc++6.0c++课程设计vc++6.0c++课程设计vc++6.0
VC++6.0 开发宝典 VC++6.0 开发宝典 VC++6.0 开发宝典