关键字: Include lib 快捷键
VC7.1中项目的包含目录及快捷键是修改比较频繁的设置, 如果要重装VC再次设置是比较麻烦的事情, 这里讨论一下如何方便的备份和修改这两项.
1. 存放的位置
Include等信息放在如下目录中
C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\VisualStudio\7.1
快捷键文件放在如下目录中
C:\Documents and Settings\Administrator\Application Data\Microsoft\VisualStudio\7.1
2. 用bat文件把上述文件拷贝到d:的备份目录中
SET key_dir="C:\Documents and Settings\Administrator\Application Data\Microsoft\VisualStudio\7.1"
SET projects_dir="C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\VisualStudio\7.1"
set bak_dir="D:\My Documents\vc\"
copy %key_dir%\*.vsk %bak_dir%
copy %projects_dir%\*.dat %bak_dir%
3. 让VC7 ide使用VC6的编译器及编译环境
进入C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\VisualStudio\7.1
把VCComponents.dat复制两份, 分别命名为VCComponents_vc6.dat VCComponents_vc71.dat
同时修改两文件里的内容, 71可保持与原文件内容一致, vc6的内容如下
[VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories]
Path Dirs=D:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;D:\Program Files\Microsoft Visual Studio\VC98\Bin;$(VSInstallDir)Common7\Tools\bin;;$(VSInstallDir)Common7\tools;;C:\Program Files\HTML Help Workshop\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Include Dirs=D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE;D:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE;D:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE;
Reference Dirs=$(FrameWorkDir)$(FrameWorkVersion)
Library Dirs=D:\Program Files\Microsoft Visual Studio\VC98\LIB;D:\Program Files\Microsoft Visual Studio\VC98\MFC\LIB
Source Dirs=D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC;D:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE;D:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE;D:\Program Files\Microsoft Visual Studio\VC98\CRT\SRC
在VC7的宏编辑器里加入快速切换的函数, 内容如下
'2009/6/16
' 替换VC目录依赖
' 变更VC6及VC71的编译依赖目录内容
Sub ChangeIncludesDirectoryTo6()Sub ChangeIncludesDirectoryTo6()
Dim dir As String = "C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\VisualStudio\7.1"
Dim vc7 As String = "VCComponents_vc71.dat"
Dim vc6 As String = "VCComponents_vc6.dat"
Dim vc As String = "VCComponents.dat"
'拷贝文件
FileSystem.FileCopy(dir + "\" + vc6, dir + "\" + vc)
'重启VC让设置生效
DTE.Quit()
End Sub
Sub ChangeIncludesDirectoryTo7()Sub ChangeIncludesDirectoryTo7()
Dim dir As String = "C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\VisualStudio\7.1"
Dim vc7 As String = "VCComponents_vc71.dat"
Dim vc6 As String = "VCComponents_vc6.dat"
Dim vc As String = "VCComponents.dat"
'拷贝文件
FileSystem.FileCopy(dir + "\" + vc7, dir + "\" + vc)
DTE.Quit()
End Sub
点击宏中的两个函数, 即可快速在VC6及VC7编译环境中切换
注: 在工程中添加文件需在VC6中进行, 然后在VC7中编辑及编译
posted on 2009-07-22 11:10
wangkang 阅读(1284)
评论(0) 编辑 收藏 引用