您的位置:程序门 -> c++ builder ->



动态建立控件增加方法


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


动态建立控件增加方法[已结贴,结贴人:xugeng]
发表于:2007-10-09 21:22:33 楼主
建立方法原型:  
void   __fastcall   cppwebbrowserdocumentcomplete(tobject   *sender,   lpdispatch   pdisp,   variant   *url);
建立对象:
                                thewebbrowse[0]   =   new     tcppwebbrowser(this);
                                thewebbrowse[0]-> ondocumentcomplete     =   cppwebbrowserdocumentcomplete;
错误提示:

[c++   error]   twebbrowse.h(43):   e2034   cannot   convert   'void   (_fastcall   *   (_closure   )(tobject   *,idispatch   *,variant   *))(tobject   *,idispatch   *,variant   *)'   to   'void   (_fastcall   *   (_closure   )(tobject   *,idispatch   *,tagvariant   *))(tobject   *,idispatch   *,tagvariant   *)'

variant   与tagvariant   有什么不同,怎么转换?
发表于:2007-11-02 00:42:211楼 得分:20
variant是一个类,tagvariant是一个结构。

解决方法:
c/c++ code
thewebbrowse[0]- >ondocumentcomplete = (tnotifyevent)&cppwebbrowserdocumentcomplete;
发表于:2008-01-22 14:24:412楼 得分:0
妖哥
你好,我添加(tnotifyevent)&   之后,一样的错误

                webs[i]-> ondocumentcomplete=(tnotifyevent)&cppwebbrowsertestdocumentcomplete;
cannot       convert       'void       (_fastcall       *       (_closure       )(tobject       *,idispatch       *,variant       *))(tobject       *,idispatch       *,variant       *)'       to       'void       (_fastcall       *       (_closure       )(tobject       *,idispatch       *,tagvariant       *))(tobject       *,idispatch       *,tagvariant       *)'  



快速检索

最新资讯
热门点击