[译]VC ++ 7至VC ++ 6项目转换器
By robot-v1.0
本文链接 https://www.kyfws.com/applications/vc-7-to-vc-6-project-converter-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 6 分钟阅读 - 2740 个词 阅读量 0[译]VC ++ 7至VC ++ 6项目转换器
原文地址:https://www.codeproject.com/Articles/2951/VC-7-to-VC-6-project-converter
原文作者:Stephane Rodriguez.
译文由本站 robot-v1.0 翻译
前言
This tool automatically converts Visual C++ 7.0 projects back to Visual C++ 6.0 projects.
此工具自动将Visual C ++ 7.0项目转换回Visual C ++ 6.0项目.
这是什么 ?(What is this ?)
该工具自动转换(This tool automatically converts)回到顶端Visual C ++ 7.0项目(Visual C++ 7.0 projects back to Visual C++ 6.0 projects).换一种说法,(. In other words,).sln(.sln*)*/(*/*)*.vcproj(*.vcproj*)*文件对转换为(*file pairs are translated to*)*.dsw(*.dsw*)*/(*/*)*.dsp(*.dsp*)*文件对.(*file pairs.*)
重要说明,转换过程中没有损失:源代码保持不变;只要(Important note, there is no loss during the conversion: source code is left unchanged; only).dsw(.dsw*)*/(*/*)*.dsp(*.dsp*)*被创建(或覆盖).(*are created (or overwritten).*)
为什么?(Why?)
首先,因为MS不提供它.当您感到卖掉开发人员工具而没有所有必要的" moulinettes"(丑陋的转换器)倒退时,对MS持怀疑态度很容易.(First of all because MS doesn’t provide it. It’s easy to become cynical against MS when you feel how bad it is to sell developer tools without all the necessary “moulinettes” (converters in ugly English) to go backward.)
如果没有此工具,最终将无法从头开始创建项目:浪费时间,并且容易出错.实际上,在几种情况下此工具很有用:(Without this tool, you end up recreating your projects from scratch: a total waste of time, and prone to errors. Actually there are several scenarios where this tool is useful:)
- 有人为您提供了VC ++ 7项目,而您仅安装了VC ++ 6.(Someone gives you a VC++ 7 project, and you only have VC++ 6 installed.)
- 您已将项目从VC ++ 6升级到VC ++ 7,并且同时拥有(You have upgraded your project(s) from VC++ 6 to VC++ 7, and you have both).dsw(.dsw*)*/(*/*)*.dsp(*.dsp*)*和(*and*)*.sln(*.sln*)*/(*/*)*.vcproj(*.vcproj*)*本地系统驱动器上的文件,但是您愿意使这些文件保持同步,因此在任何时候需要打开项目时,都无需打扰使用的VC ++版本.(*files on your local system drive, but you are willing to keep those files synchronized so any time you need to open the project, you need not bother the VC++ version you work with.*)
- 提供两个版本的项目(例如,当您在CodeProject上共享代码时),因此您的听众无需费心知道需要哪个devtool.(Provide both versions of projects (for instance when you share code on CodeProject), so your audience does not need to bother with knowing which devtool is required.)
如何使用它(How to use it)
该工具是以下形式的命令行:(The tool is a command line of the form:)
prjconverter <solutionname (full filepath)>[.sln]
例如,(For instance,)
prjconverter c:\tmp\betterxml\betterxml.sln
有关信息,请键入(For info, type)*prjconverter.exe(prjconverter.exe)*独自在控制台中.(alone in the console.)
转换成什么(What is converted)
几个步骤可让您知道工作的完成方式.的(A few steps to let you know how the work gets done. The).sln(.sln*)*解决方案文件已打开并转换为(*solution file is opened and translated to the*)*.dsw(*.dsw*)*文件格式,以及所有项目声明,依赖项和源代码控制标签.(*file format, along with all project declarations, dependencies, and source control tags.*)
然后全部(Then all).vcproj(.vcproj*)*项目文件被翻译成(*project files are translated to*)*.dsp(*.dsp*)*文件.我使用MSXML解析(*files. I use MSXML to parse the*)*.vcproj(*.vcproj*)*文件格式,并从中构建元模型.然后剩下要做的就是将所有这些XML东西序列化为标准(*file format, and build the meta-model out of it. Then what’s left to do is serialize all those XML thingies into the standard*)*.dsp(*.dsp*)*符号线.(*symbol lines.*)
当然,我们关心项目配置(调试,发布,…)和自定义文件配置设置.(Of course we care about project configurations (debug, release, …), and custom file configuration settings.)
技术细节(Technical details)
在提供的代码中,(In the code provided,)slnprocess.cpp(slnprocess.cpp)是否(does the).sln(.sln*)*=>(*=>*)*.dsw(*.dsw*)*转换.(*conversion.*)*vcprojprocess.cpp(*vcprojprocess.cpp*)*是否(*does the*)*.vcproj(*.vcproj*)*=>(*=>*)*.dsp(*.dsp*)*转换.和(*conversion. And*)*vcprojconfiguration.cpp(*vcprojconfiguration.cpp*)*保存项目元模型(所有项目设置选项卡).在VC ++ 7中,元模型现在是可编程的.让我们看看这个(*holds the project meta-model (all project setting tabs). In VC++ 7, the meta-model is now programmable. Let’s check out this*) 链接(link) .事实上,(*. In fact,*)*vcprojconfiguration.cpp(*vcprojconfiguration.cpp*)*恰好反映了此元模型(就像它是内部MS代码一样).(*reflects exactly this meta-model (as if it was internal MS code).*)
免责声明(Disclaimer)
该工具在发布之前已经进行了广泛的测试(MFC/COM/ATL/控制台应用程序,makefile等).尽管我愿意知道有什么我可以做的以改进它,但是让我清楚地说,如果您的项目被此工具破坏,那不是我的错.(This tool has been extensively tested before being published (MFC/COM/ATL/console apps, makefiles, …). Though I am willing to know if there is anything I can do in order to improve it, let me clearly say that it’s not my fault if your project is corrupted by this tool.)
更新记录(Update history)
- 9月27日-代码完成(Sept 27 - code complete)
- 10月2日-现在可以转换(Oct 2 - now it is possible to convert).vcproj(.vcproj*)*仅文件(无需root)(*files alone (no need of a root*)*.sln(*.sln*)*文件):只需键入(*file): just type the*)*.vcproj(*.vcproj*)*命令行中的完整路径.(*full path in the command line.*)
- 10月30日-根据用户反馈进行了改进:添加了缺少的默认链接库,扩展了某些宏变量,例如(Oct 30 - improvements based on user feedback: added missing default link libraries, expanded certain macro variables such like)
$(OutDir)
和(and)$(IntDir)
,替换或删除了VC6不支持的某些宏变量,例如(, replaced or removed certain macro variables not supported by VC6 such like)$(NoInherit)
, 添加(, added)/GX(/GX*)*(已启用异常处理).(*(exception handling enabled).*) - 11月13日-错误修复:文件名带有空格,MFC扩展DLL支持,自定义预编译头设置,项目设置继承.(Nov 13 - bug fixes: filenames with spaces, MFC extension DLL support, custom precompiled header setting, project setting inheritance.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
VC7.0 C++ VC6 WinXP Windows Win2K Visual-Studio Dev 新闻 翻译