初学者实用编程开发工具
预想善其事,必先利其器
一、编程开发者,必思考其问题,代码哪里写、如何编译执行(或则不需编译),如何调试
如何测试……
一系列的问题,每个步骤几乎都离不开相应的工具,其中,每个步骤几乎也有相对应的工具,我们本次聊聊,在C++的学习开发过程中,所需要用到的一些工具。
二、工具
1、键盘快速启动工具(Launchy)
2、比较工具(Beyond Compare)
3、代码编辑器(NotePad++)
4、编译器(vc vs gcc)
5、VC助手
6、 项目开发程序编辑器和代码浏览器(Source Insight)
7、 内存泄露检测工具(VLD)
8、 动态链接库查看工具(Depends)
9、 版本控制器(SVN,Github)
10、在编译器中制作 (宏工具)
(1) 函数头说明
(2) 多行注释工具
(3) 头文件预处理命令
11、给代码工程改头换面
12、Installshield
三、重点讲解
1、比较工具使用
2、内存泄露检测工具的安装与使用
3、动态链接库产看工具
4、制作宏工具
5、vc助手
四、附录
1、函数头描述脚本
Sub FunctionDesc()
Dim doc
set doc = ActiveDocument
' Be sure activedocument is a text document
if doc Is Nothing Then
Exit Sub
elseif doc.Type <>"Text" Then
Exit Sub
End If
doc.Selection ="/** "
doc.Selection.NewLine
doc.Selection = " *函数名 : "
doc.Selection.LineDown
doc.Selection.copy
doc.Selection.LineUp
doc.Selection.EndOfLinedsLastText
doc.Selection =doc.Selection + " "
doc.Selection.paste
doc.Selection = " *功能描述:"
doc.Selection.NewLine
doc.Selection = "* 输入参数:"
doc.Selection.NewLine
doc.Selection = "* 输出参数:"
doc.Selection.NewLine
doc.Selection = "* 返回值 :"
doc.Selection.LineDown
doc.Selection.StartOfLinedsFirstText
'doc.Selection.CharRight dsExtend, 4
doc.Selection.WordRightdsExtend, 1
doc.Selection.copy
doc.Selection.LineUp
doc.Selection.EndOfLinedsLastText
doc.Selection =doc.Selection + " "
doc.Selection.paste
doc.Selection.NewLine
doc.Selection = "* 作者 : Bss "
doc.Selection.NewLine
doc.Selection = "* 创建日期: " + CStr(Now())
doc.Selection.NewLine
doc.Selection = "*/"
End Sub
2、文件头注释宏
Sub FileDesc()
Dim doc
set doc = ActiveDocument
' Be sure activedocument is a text document
if doc Is Nothing Then
Exit Sub
elseif doc.Type <>"Text" Then
Exit Sub
End If
doc.Selection.MoveTo 1,1
doc.Selection.NewLine
doc.Selection.MoveTo 1,1
doc.Selection ="/** "
doc.Selection.NewLine
doc.Selection = " *版权说明 Contectcopyright (c)"
doc.Selection.NewLine
doc.Selection = "* 文件名 : " +ActiveDocument.Name
doc.Selection.NewLine
doc.Selection ="* 文件描述:"
doc.Selection.NewLine
doc.Selection = "* 创建日期: " + CStr(Now())
doc.Selection.NewLine
doc.Selection = "* 作者 : lhy"
doc.Selection.NewLine
doc.Selection = "*/"
End Sub
3、多行注释宏
Sub CustomCommentOut()
'DESCRIPTION: 注释/取消注释宏,可处理VB和C++、Java注释
Dim win
set win = ActiveWindow
If win.type <> "Text" Then
MsgBox "This macro can only berun when a text editor window is active."
Else
TypeOfFile = 3
If TypeOfFile > 0 AndTypeOfFile < 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
Temp = StartLine
StartLine = EndLine
EndLine = Temp
End If
' 单行
If EndLine = StartLineThen
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
五、具体讲解请访问
http://edu.51cto.com/course/course_id-5014.html