EVC工程移植到VS2005的经验_第1页
EVC工程移植到VS2005的经验_第2页
EVC工程移植到VS2005的经验_第3页
EVC工程移植到VS2005的经验_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

本文是针对作者本人的一个具体的移植项目 将碰到的所有问题列出来 并给出具体 的解决方法 由于是一个具体的项目 因此不能把所有的 EVC 工程移植问题囊括进来 所以 在移植项目前 建议还是看看以下的文章 循序渐进 将 eMbedded Visual C 应用程序迁移到 Visual Studio 2005 eMbedded Visual C 到 Visual Studio 2005 升级向导 注意其最后一句话 默 认情况下 Embedded Visual C 4 0 版会将 MFC Pocket PC 应用程序的对话 框样式 Border 设置为 DS MODALFRAME MFC 8 0 不支持此样式 应改 为 Thin 如果不改的话 窗口就无法弹出 从 eVC 移植所带来的已知问题 Migrating Microsoft eMbedded Visual C Projects to Visual Studio 2005 开发环境 Windows XP SP2 Visual Studio 2005 professional Windows Mobile 6 0 Professional SDK 注 1 对于 Windows Mobile 5 0 SDK 开发的程序在 Windows Mobile 6 0 下也 能运行 而且不需要对程序进行任何的修改 2 由于有些错误 是环境配置问题 所以在 Debug Resease 模式下 都需要 进行修改 以下错误中 如果是这类错误 都在标号后面写着 Resealse 模式也需 要改 当天切换到别的 SDK 下 如 Windows Mobile 5 0 SDK 也需要修改 以下是针对 Debug 模式下的 1 StdAfx cpp Resealse 模式也需要改 编译错误 D Program Files Microsoft Visual Studio 8 VC ce atlmfc include afxver h 77 fatal error C1189 error Please use the MD switch for AFXDLL builds 解决方法 右击工程名 打开 Project properties 对话框 切换到 C C Code generation 页 将 Runtime Libarary 设置成 Multi threaded DLL MD 即可 解决此问题 2 编译错误 error C2065 i undeclared identifier 原因 是由于存在以下的代码段 for int i 0 i MAX LEN i for i 0 i MAX NUM i 对于 evc 离开循环后 循环变量仍然有效 并且仍可以使用 但是在 VS2005 下是不 行的 由此可见 VS2005 对变量的定义与审查更为严格 还有就是对数组越界问题也 比 EVC 来的强 解决方法 不能完全相信编译器 也不能把所有的语法检查都丢给编译器 int i 0 for i 0 i MAX LEN i for i 0 i 212 define NUM TOOL TIPS 8 endif 7 error C3861 ON WM HELPINFO identifier not found 同 4 8 error C2440 static cast cannot convert from void cdecl CMyAppView void to LRESULT cdecl CWnd WPARAM LPARAM None of the functions with this name in scope match the target type 解决方法 afx msg void OnHotLinkExplain afx msg LRESULT OnHotLinkExplain WPARAM wParam LPARAM lParam 9 error C2664 CSize CDC GetTextExtent LPCTSTR int const cannot convert parameter 1 from WORD to LPCTSTR Types pointed to are unrelated conversion requires reinterpret cast C style cast or function style cast 需要强制转换 pDC GetTextExtent pDC GetTextExtent LPCTSTR 10 error C2039 OnHelpInfo is not a member of CView error C2039 OnHelpInfo is not a member of CFrameWnd error C2039 OnHelpInfo is not a member of CDialog 解决方法 用 TRUE 替换相应的类成员函数 OnHelpInfo return CView OnHelpInfo pHelpInfo return TRUE 11 error C2039 m bShowSharedNewButton is not a member of CCommandBar D Program Files Microsoft Visual Studio 8 VC ce atlmfc include afxext h 557 see declaration of CCommandBar 解决方法 直接注释掉 m wndCommandBar m bShowSharedNewButton FALSE 12 MyApp rc 380 fatal error RC1015 cannot open include file wceres rc 解决方法 直接注释掉 include wceres rc WCE specific components 但是 这个错误很讨厌 每次你修改资源文件后 都得修改该语句 不知道为什么 13 Resease 模式下也要修改 error LNK2019 unresolved external symbol SHInitExtraControls referenced in function protected cdecl CMyAppView CMyAppView void 0CMyAppView IAA XZ 问题 程序中调用了 SHInitExtraControls error LNK2019 unresolved external symbol SHSipPreference referenced in function protected void cdecl CMyAppView OnKillfocusWord void OnKillfocusWord CMyAppView IAAXXZ 问题 程序中调用了 SHSipPreference 以上两个函数都在 Library aygshell lib 里 解决方法 工程 属性 Linker input Additional Denpendencies aygshell lib 14 Resease 模式下也要修改 orelibc lib wwinmain obj error LNK2019 unresolved external symbol wWinMain referenced in function wWinMainCRTStartup 属性 Linker Anvanced EntryPoint 将 wWinMainCRTStartup 更改为 WinMainCRTStartup Entry Point 是 WinMainCRTStartup ANSI 或 wWinMainCRTStartup UINCODE 即 WinMainCRTStartup 或 wWinMainCRTStartup 会调用 WinMain 或 wWinMain 15 error C3861 LoadStdProfileSettings identifier not found 注释掉函数 LoadStdProfileSettings 该函数的具体功能 看 MSDN BTW 编译的时候 有可能会出现一些由以上错误产生的连锁错误 俗称 蝴蝶效 应 如 error C2143 syntax error missing before error C2143 syntax error missing before error C2143 syntax error missing before 少了了 等等 把以上的错误 主要矛盾解决了 这些错误 错误矛盾也就迎 刃而解了 何况 这个工程是以前在 EVC IDE 下编译通过 MS 再怎么优化或改进编 译器 也总不可能发生自相矛盾的事情吧 总要考虑兼容性吧 要对自己或公司的前 辈有信心 到此 已经能够编译通过 但是运行的时候 又出现如下的问题 16 Resease 模式下也要修改 按 F5

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论