Visual Studio IDE中快速进行h文件和cpp文件切换的宏
来源:互联网 发布:pop3和smtp端口被占用 编辑:程序博客网 时间:2024/05/21 08:04
Visual Studio IDE中快速进行h文件和cpp文件切换的宏
新建一个宏模块,把以下代码复制到模块中保存,然后选择“工具->选项->环境->键盘”,在显示命令包含中输入SourceHeaderJumper找到相应命令,选中后绑定一个快捷键即可。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
SubSourceHeaderJumper()
'splitted file name
DimSArr AsSystem.Array
'new filename generated by macros
DimNewFN AsString
'file name base (without extention)
DimFNBase AsString
'file extention
DimExt AsString
'simple counter
Dimi AsInteger
IfDTE.ActiveDocument()Is NothingThen
ExitSub
EndIf
SArr= DTE.ActiveDocument().Name().Split(".")
'has file extention?
If(SArr.GetLength(0)< 2)Then
ExitSub
EndIf
'file name base
FNBase= DTE.ActiveDocument().Path()
Fori =0 ToSArr.GetLength(0)- 2
FNBase= FNBase+ SArr(i)+ "."
Next
'file extention
Ext= System.Convert.ToString(SArr(SArr.GetLength(0)- 1)).ToLower()
'business logic
If(Ext= "cpp")Or (Ext= "c")Then
NewFN= FNBase+ "h"
Else
IfExt ="h" Then
NewFN= FNBase+ "cpp"
IfNot System.IO.File.Exists(NewFN)Then
NewFN= FNBase+ "c"
EndIf
EndIf
EndIf
'if you don't want add file to tabs uncomment next line
'DTE.ActiveDocument().Close()
'opens needed file
IfSystem.IO.File.Exists(NewFN)Then
DTE.ItemOperations.OpenFile(NewFN)
EndIf
EndSub
取自:
http://www.codeproject.com/KB/macros/SourceHeaderJumper.aspx
C中传递变长参数的使用方法
VS2005编译使用tesseract-orc 2.04
0 0
- Visual Studio IDE中快速进行h文件和cpp文件切换的宏
- visual studio 之头文件与cpp之间进行切换
- 如何在 Visual Studio 2015 中自动给 cpp 和 h 文件添加头部注释
- vs中.h文件与.cpp文件之间的切换
- 一键在emacs中切换C++ .h文件和.cpp文件
- 【IDE-Visual Studio】关于exe的版本中“文件版本”和其他版本信息中的“文件版本”、以及“产品版本”
- source insight中cpp文件和h文件的切换(使用si的内置语言实现)[增加src/include目录切换]
- cpp文件和.h文件
- 在Studio中快速切换两个文件
- .h和.cpp文件的区别
- .h和.cpp文件的区别
- .h和.cpp文件的区别
- .h和.cpp文件的区别
- .h和.cpp文件的区别
- .h和.cpp文件的区别
- .h和.cpp文件的区别
- .h和.cpp文件的区别
- .h和.cpp文件的区别
- c++ 类中const成员变量的赋值
- Gson解析json 三
- Tomcat部署报错: An internal error occurred during: "Redeploy". java.lang.NullPointerException
- 总结的小算法
- ListView 一行行显示动画效果
- Visual Studio IDE中快速进行h文件和cpp文件切换的宏
- c# WPF socket 编程
- iOS 获取wifi ssid 名
- 值得mark的11个开源机器学习项目 .
- AngularJS学习笔记(3)- AngularJS 指令
- vsftp服务器实现匿名用户
- ACM-三角形
- J2SE总结(二)——线程
- 贝叶斯方法