lexliy / duilib

Automatically exported from code.google.com/p/duilib
1 stars 0 forks source link

error C2371: “IDispatchEx”: 重定义;不同的基类型 #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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”

Original issue reported on code.google.com by gao201...@gmail.com on 4 Nov 2013 at 2:53

GoogleCodeExporter commented 9 years ago
any help for this? include windows SDK and enable flash OCX?

Original comment by bygree...@gmail.com on 8 Nov 2013 at 10:34

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
看来还是得自己动手解决,公布fix的方法:
UIFlash.h
行:
  #import "..\Utils/Flash11.tlb" raw_interfaces_only, named_guids
改为:
  #import "..\Utils/Flash11.tlb" raw_interfaces_only, named_guids, rename("IDispatchEx","IMyDispatchEx")
可以解决以上的问题。

为了兼容性更好,防止系统flash的插件更新后又有问题,干脆
直接导入你自己系统的OCX,于是将这一行最好改为:
  #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 */  

Original comment by bygree...@gmail.com on 9 Nov 2013 at 6:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
多谢楼上,问题解决 O(∩_∩)O~

Original comment by Rydiy.Z...@gmail.com on 13 Nov 2013 at 6:56

GoogleCodeExporter commented 9 years ago
vs2013编译duilib问题
需修改多一个名称
#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")

Original comment by mengfeng...@gmail.com on 1 Dec 2013 at 8:14

GoogleCodeExporter commented 9 years ago
看下如此改动是否好些,结合前人经验
#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

Original comment by chexie...@gmail.com on 8 Jan 2014 at 9:16

GoogleCodeExporter commented 9 years ago
这个问题,还要注意一点就是安装一个 flash player. 
这算是一个环境吧. 作者在之前没写清楚. 

Original comment by easy...@gmail.com on 4 Apr 2014 at 3:50