转载:VC++6.0注释快捷键设置,略有修改
在Qt Creator,eclipse等编辑器中,都默认有注释代码的快捷键:Ctrl + /。
注释快捷键在程序编程当中的作用相当明显,提高了编程效率。我在网上找到了一个在VC++6.0工具中添加注释快捷键的方法,VC++6.0是以VB为脚本来配置的。
首先,找到VC++6.0的安装路径,假设在:D:\Program Files (x86)\Microsoft Visual Studio 6.0,那么进入到Common\MSDev98\Macros目录下,全路径为:D:\Program Files (x86)\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.Add-ins and Macro Files(附加项和宏文件) 勾选上 comment(对应上面的comment.dsm)

3.Keyboard(键盘)选项按下图配置

4.在代码中,只需要选中代码或者在光标所在行,执行快捷键"Ctrl + /",进行注释或取消注释。
转载:VC++6.0注释快捷键设置,略有修改的更多相关文章
- VC++6.0注释快捷键设置
在Qt Creator,eclipse等编辑器中,都默认有注释代码的快捷键:Ctrl + /. 注释快捷键在程序编程当中的作用相当明显,提高了编程效率.我在网上找到了一个在VC++6.0工具中添加注释 ...
- VC++6.0注释快捷键的添加使用
在eclipse等编辑工具中都有注释代码的快捷键,但是vc++6.0没有. vc++是以VB为脚本来控制的,在网上找到了一个VB的脚本供大家使用. 工具/原料 VC++6.0 方法/步骤 打开VC ...
- Source Insight常用快捷键及注释快捷键设置
转:http://blog.csdn.net/tlaff/article/details/6536610 在使用SI过程中,我根据自己的使用习惯修改了它的默认快捷键,并且在配置文件中添加了一些人性化功 ...
- IDEA模板注释及相关快捷键设置
IDEA模板注释及相关快捷键设置 最近使用IDEA时发现自带的模板注释不怎么好用,因此自己根据网上的教程总结了适合自己的模板设置,可以一键生成类和方法的注释,废话不多说一起看看吧: 第9步的类模板注释 ...
- VC++6.0 下配置 pthread库2010年12月12日 星期日 13:14VC下的pthread多线程编程 转载
VC++6.0 下配置 pthread库2010年12月12日 星期日 13:14VC下的pthread多线程编程 转载 #include <stdio.h>#include &l ...
- Wing IDE设置(自动补全&注释快捷键)
自动补全(默认使用Tab键自动补全) 修改方法:edit -> preferences -> Editor -> Auto-completion 把右边keys的地方,从tab改成 ...
- EditPlus设置html和js文件的注释快捷键
EditPlus默认是可以通过快捷键注释html的,格式是 <!-- </label> <label>类型</label> <label> --& ...
- 【转载】 Eclipse注释模板设置详解
Eclipse注释模板设置详解 网站推荐: 金丝燕网(主要内容是 Java 相关) 木秀林网(主要内容是消息队列)
- Hotkeys.js 2.0.2 发布,JS 网页快捷键设置,捕获键盘输入和输入的组合键快捷键,它没有依赖
这是一个强健的 Javascript 库用于捕获键盘输入和输入的组合键,它没有依赖,压缩只有只有(~3kb),gzip:1.9k. 更新内容: 添加测试用例: 添加更多特殊键支持: 修复bug. __ ...
随机推荐
- IO实时监控命令iostat详解
iostat用于输出CPU和磁盘I/O相关的统计信息 命令格式 iostat [ -c ] [ -d ] [ -h ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] ...
- ASP.NET Core 之 Identity
Claims:声明(证件单元)Identity:身份Principal:当事人Authentication :认证Authorization:授权 http://www.cnblogs.com/sav ...
- 微信小程序获取用户手机号详解
最近在做一款微信小程序,需要获取用户手机号,具体步骤如下: 流程图: 1.首先,客户端调用wx.login,回调数据了包含jscode,用于获取openid(用户唯一标识)和sessionkey(会话 ...
- Unity性能优化之特效合并
特效合并,意思是说将粒子所用的零碎图片,以shader为单位合并成一张图集,好处就是可以降低draw call.试想,合并前每个粒子使用一个material,而每一个material就要占用一个dra ...
- nrm 使用
全局安装 npm i nrm -g 全局安装nrm nrm ls 查看镜像地址: npm ---- https://registry.npmjs.org/ cnpm --- http://r.c ...
- percona-toolkit工具的使用
percona-toolkit是一组高级命令行工具的集合,可以查看当前服务的摘要信息,磁盘检测,分析慢查询日志,查找重复索引,实现表同步等等 percona-toolkit 源自 Maatkit 和 ...
- week_one-python基础 列表 增删改查
# Author:larlly #列表增删改查#定义列表name = ["wo","ni","ta","wo"] #定义 ...
- jQuery图片无缝轮播
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- Zeu.js
一个生成各种 GIF 动画的 JavaScript 类库,非常适合用于让你的数据展示变得更加地生动.使用起来也非常简单,有数据展示需求的同学可以尝试一下.https://shzlw.github.io ...
- mysql插入数据报错1366
数据表插入中文数据报错 Warning Code : 1366 Incorrect string value: '\xE5\x9C\xA8' for column 'name' at row 1 原因 ...