日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > c/c++ >内容正文

c/c++

vc6.0注释功能的脚本快捷键设置代码

發布時間:2025/5/22 c/c++ 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vc6.0注释功能的脚本快捷键设置代码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

找到vc6.0的安裝路徑,vc6.0的默認安裝路徑是C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Macros。在Macros目錄里面創建一個空文本,將如下代碼添加到文本中去,將名字命名為comment.dsm。然后安裝下圖方法添加工具進去

在文件里面添加一下代碼:

Sub CustomCommentOut() 'DESCRIPTION: 注釋/取消注釋宏,可處理VB和C++、Java注釋Dim winset win = ActiveWindowIf win.type <> "Text" ThenMsgBox "This macro can only be run when a text editor window is active."ElseTypeOfFile = 3If TypeOfFile > 0 And TypeOfFile < 6 ThenIf TypeOfFile > 3 ThenCommentType = "'" ' VB注釋CommentWidth = 1ElseCommentType = "//" ' C++、java 注釋CommentWidth = 2End IfStartLine = ActiveDocument.Selection.TopLineEndLine = ActiveDocument.Selection.BottomLineIf EndLine < StartLine ThenTemp = StartLineStartLine = EndLineEndLine = TempEnd If' 單行If EndLine = StartLine ThenActiveDocument.Selection.StartOfLine dsFirstColumnActiveDocument.Selection.CharRight dsExtend, CommentWidthIf ActiveDocument.Selection = CommentType ThenActiveDocument.Selection.DeleteElseActiveDocument.Selection.StartOfLine dsFirstTextActiveDocument.Selection.CharRight dsExtend, CommentWidthIf ActiveDocument.Selection = CommentType ThenActiveDocument.Selection.CharRight dsExtendActiveDocument.Selection.DeleteElseActiveDocument.Selection.StartOfLine dsFirstTextActiveDocument.Selection = CommentType + vbTab + _ActiveDocument.SelectionEnd IfEnd If' 多行ElseFor i = StartLine To EndLineActiveDocument.Selection.GoToLine iCommentLoc = dsFirstColumnActiveDocument.Selection.StartOfLine CommentLocActiveDocument.Selection.CharRight dsExtend, CommentWidthIf ActiveDocument.Selection = CommentType ThenActiveDocument.Selection.DeleteElseActiveDocument.Selection.StartOfLine CommentLocActiveDocument.Selection = CommentType + _ActiveDocument.SelectionEnd IfNextEnd IfElseMsgBox("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 IfEnd If End Sub

此時打開VC++6.0窗口,以下步驟:

1.打開菜單欄"Tools" -> “Customize” 打開了"Customize"對話框。


  • 4.在代碼中,只需要選中代碼或者在光標所在行,執行快捷鍵"Ctrl + /",進行注釋或取消注釋。

    總結

    以上是生活随笔為你收集整理的vc6.0注释功能的脚本快捷键设置代码的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。