WINCE CEWMPHostM例子在VS2005 WINCE5.0下编译(转载)

1,使用VS2005 自带的转换工具把它转为vs2005下的工程。

如果这样马上编译会得到如下的错误:

Rebuild All started: Project: SPWmpHost, Configuration: Debug Pocket PC 2003 (ARMV4) ------
1>Deleting intermediate and output files for project 'SPWmpHost', configuration 'Debug|Pocket PC 2003 (ARMV4)'
1>Compiling...
1>wmphost.cpp
1>_CE_ACTIVEX was not defined because this Windows CE SDK does not have DCOM.
1> _CE_ACTIVEX could be caused to be defined by defining _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA, but it is recommended that this be done only for single-threaded apps.
1>_ATL_NO_HOSTING was defined because _CE_ACTIVEX was not defined.
1>WINVER was defined to be 0x0400, as it was either not set or set to a lower value
1>D:/Program Files/Microsoft Visual Studio 8/VC/ce/atlmfc/include/atlhost.h(43) : fatal error C1189: #error :  atlhost.h requires Hosting support (_ATL_NO_HOSTING is defined).  For Windows CE platforms without DCOM support, _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA needs to be defined.
1>WMPGuids.cpp
1>PopDlgs.cpp
1>_CE_ACTIVEX was not defined because this Windows CE SDK does not have DCOM.
1> _CE_ACTIVEX could be caused to be defined by defining _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA, but it is recommended that this be done only for single-threaded apps.
1>_ATL_NO_HOSTING was defined because _CE_ACTIVEX was not defined.
1>WINVER was defined to be 0x0400, as it was either not set or set to a lower value
1>D:/Program Files/Microsoft Visual Studio 8/VC/ce/atlmfc/include/atlhost.h(43) : fatal error C1189: #error :  atlhost.h requires Hosting support (_ATL_NO_HOSTING is defined).  For Windows CE platforms without DCOM support, _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA needs to be defined.
1>MediaLibraryDlg.cpp
1>_CE_ACTIVEX was not defined because this Windows CE SDK does not have DCOM.
1> _CE_ACTIVEX could be caused to be defined by defining _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA, but it is recommended that this be done only for single-threaded apps.
1>_ATL_NO_HOSTING was defined because _CE_ACTIVEX was not defined.
1>WINVER was defined to be 0x0400, as it was either not set or set to a lower value
1>D:/Program Files/Microsoft Visual Studio 8/VC/ce/atlmfc/include/atlhost.h(43) : fatal error C1189: #error :  atlhost.h requires Hosting support (_ATL_NO_HOSTING is defined).  For Windows CE platforms without DCOM support, _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA needs to be defined.
1>CWMPHost.cpp
1>_CE_ACTIVEX was not defined because this Windows CE SDK does not have DCOM.
1> _CE_ACTIVEX could be caused to be defined by defining _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA, but it is recommended that this be done only for single-threaded apps.
1>_ATL_NO_HOSTING was defined because _CE_ACTIVEX was not defined.
1>WINVER was defined to be 0x0400, as it was either not set or set to a lower value
1>D:/Program Files/Microsoft Visual Studio 8/VC/ce/atlmfc/include/atlhost.h(43) : fatal error C1189: #error :  atlhost.h requires Hosting support (_ATL_NO_HOSTING is defined).  For Windows CE platforms without DCOM support, _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA needs to be defined.
1>CWMPEventDispatch.cpp
1>_CE_ACTIVEX was not defined because this Windows CE SDK does not have DCOM.
1> _CE_ACTIVEX could be caused to be defined by defining _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA, but it is recommended that this be done only for single-threaded apps.
1>_ATL_NO_HOSTING was defined because _CE_ACTIVEX was not defined.
1>WINVER was defined to be 0x0400, as it was either not set or set to a lower value
1>D:/Program Files/Microsoft Visual Studio 8/VC/ce/atlmfc/include/atlhost.h(43) : fatal error C1189: #error :  atlhost.h requires Hosting support (_ATL_NO_HOSTING is defined).  For Windows CE platforms without DCOM support, _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA needs to be defined.
1>Generating Code...
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 8.00.50727
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>BSCMAKE: error BK1506 : cannot open file './Pocket PC 2003 (ARMV4)/Debug/CWMPEventDispatch.sbr': No such file or directory
1>Build log was saved at "file://d:/wince/wmpmobilesamples/CEWMPHostML/Pocket PC 2003 (ARMV4)/Debug/BuildLog.htm" 

其实就是_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA  没有在编译选项定义,这样需要修改工程的设置:

具体修改如下:

1。在GENERAL选项卡的USE OF ATL一项,在下拉菜单中选择“Static Link to ATL”一项。

2.设置wmsdk的路径

 

3。增加预编译选项。

4,去掉不必要的链接库,atlce400.lib。

经过以上的修改,就可以编译这个项目文件,并且可以正确生成可执行文件。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值