Duilib Demo 编译报错:(error C2371: “IDispatchEx”: 重定义;不同的基类型)

用VS2010编译Duilib Demo时报错:

-------------------------------------------------------------------------------------
1>f:\duilib\duilib\Control/UIFlash.h(10): warning C4192: 导入类型库“IServiceProvider”时自动排除“..\Utils/Flash11.tlb”
1>  UIWebBrowser.cpp
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(217): error C2371: “IDispatchEx”: 重定义;不同的基类型
1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(53) : 参见“IDispatchEx”的声明
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(435): error C2872: “IDispatchEx”: 不明确的符号
1>          可能是“c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(217) : IDispatchEx”
1>          或       “f:\duilib\duilib\build\debug\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx”
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(869): error C2872: “IDispatchEx”: 不明确的符号
1>          可能是“c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(217) : IDispatchEx”
1>          或       “f:\duilib\duilib\build\debug\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx”
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(887): error C2872: “IDispatchEx”: 不明确的符号
1>          可能是“c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(217) : IDispatchEx”
1>          或       “f:\duilib\duilib\build\debug\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx”
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\mshtml.h(4715): error C2872: “IDispatchEx”: 不明确的符号
1>          可能是“c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(217) : IDispatchEx”
1>          或       “f:\duilib\duilib\build\debug\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx”
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\mshtml.h(4738): error C2872: “IDispatchEx”: 不明确的符号
1>          可能是“c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.h(217) : IDispatchEx”
1>          或       “f:\duilib\duilib\build\debug\flash11.tlh(297) : ShockwaveFlashObjects::IDispatchEx”


-------------------------------------------------------------------------------------


解决办法:
\DuiLib\Control\UIFlash.h 中将下行

#import "..\Utils/Flash11.tlb" raw_interfaces_only, named_guids

改为:

#if _MSC_VER<=1500     //vs2008
    #import "..\Utils/Flash11.tlb" raw_interfaces_only, named_guids
#elif _MSC_VER<=1600   //vs2010
    #import "PROGID:ShockwaveFlash.ShockwaveFlash"  \
        raw_interfaces_only,       /* Don't add raw_ to method names */ \
        named_guids,           /* Named guids and declspecs */    \
        rename("IDispatchEx","IMyDispatchEx")/* fix conflicting with IDispatchEx ant dispex.h */  
#else                  //vs2013
    #import "PROGID:ShockwaveFlash.ShockwaveFlash"  \
        raw_interfaces_only,       /* Don't add raw_ to method names */ \
        named_guids,           /* Named guids and declspecs */    \
        rename("IDispatchEx", "IMyDispatchEx")/* fix conflicting with IDispatchEx ant dispex.h */\
        rename("ICanHandleException", "IMyICanHandleException")
#endif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值