让 VS 2008 与 eVC 4.0 项目完美配合
我想为一个开源 Windows Mobile 项目做出贡献,但它是在 eVC 4.0 中开发的,该版本在 Vista 上完全不起作用(请随时纠正我!),并且我希望避免必须双重-启动或远程进入我仅存的 XP 盒子。 我在我的主开发机器上安装了VS 2008,并获得了所有SDK等。我需要做WM工作。 但! 一旦我将所有源代码放在一起并开始尝试构建它,我就必须进行大量更改以支持已弃用的方法和一些已移动的标头。
理想情况下,我希望能够“就像”我在运行 eVC 一样开展该项目。 是否有某种“怪异模式”可以让我在 VS 2008 中模拟 eVC 行为? 如果没有,是否有将应用程序从 eVC 移植到 VS 的指南?
I would like to contribute to an open-source Windows Mobile project, but it's being developed in eVC 4.0, which flat-out does not work on Vista (feel free to correct me!), and I would prefer to avoid having to dual-boot or remote into my only remaining XP box. I have VS 2008 installed on my main development machine, and got all the SDKs, etc. I need to do WM work. But! Once I got all the source code together and started trying to build it, I had to make a lot of changes to support deprecated methods and some headers that had been moved around.
Ideally, I'd like to be able to work on the project "as though" I were running eVC instead. Is there some kind of "quirks mode" that lets me emulate eVC behavior in VS 2008? If not, is there a guide to porting apps from eVC to VS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,没有任何模式允许这样做。 Studio '08 使用与 eVC 不同(实际上更好)的编译器,因此 eVC 允许的某些功能 Studio 不会。 一般来说,Studio 中的代码可以在 eVC 下运行。
现在,如果您使用 MFC,情况就完全不同了。 eVC 下的 MFC 和 Studio 下的 MFC 有很大不同,并且在某些情况下(例如 CString)只是表现不同(eVC 中的类、Studio 中的模板),特别是如果对象一开始就没有“正确”使用的话。 撤销它可能会造成巨大的混乱。
不推荐使用的方法可以包装在抽象方法中,以便在 Studio 下代码以一种方式路由,而在 eVC 下则以另一种方式路由。 如果不知道您具体使用哪些方法遇到困难,就很难给出更详细的建议。
移动的文件应该不成问题。 将包含目录添加到项目中。 您当然不应该在代码文件本身中指定标头的路径。
编辑:最后一点,Studio 在导入 eVC 项目方面通常很糟糕,因此您也很可能在迁移中丢失了预编译器指令和类似的东西。 缺少 #defines 肯定会使移植更具挑战性,因此请检查 eVC 中定义的所有内容是否仍然在 Studio 中定义。 另请注意任何子系统定义。 Studio 也喜欢忘记导入它。
No, there is no mode that's going to allow it. Studio '08 uses a different (much better in fact) compiler than eVC, so some things that eVC lets slip Studio won't. Generally speaking, the code from Studio will work under eVC.
Now if you're using MFC it's a totally different story. MFC under eVC and MFC under Studio are vastly different, and there are some cases (like CString) that just behave differently (classes in eVC, templates in Studio) especially if the objects weren't used "right" to begin with. Undoing that can be a huge mess.
Deprecated methods could be wrapped in an abstracted method so that under Studio the code routes one way and under eVC it routes another. Without knowing what methods in particular you have trouble with it's hard to give any more detailed advice.
Moved files should not be a problem. Add the include dirs to the project. You certainly shouldn't have pathing to the headers in the code files themselves.
Edit: One final note, Studio generally sucks at importing eVC projects, so it's also quite possible that you lost precompiler directives and things like that in the migration. Having missing #defines could certainly make the port more challenging, so check that everything defined in eVC is still defined in Studio. Also take note of any subsystem definition. Studio likes to forget to import that as well.