阅读:3135回复:3
ACTIVEX控件已正常运行,事件也赋值,但是用Delphi调试时,提示“找不到...
网页代码如下:
function addEventHandler(oTarget, sEventType, fnHandler) { if (oTarget.addEventListener) { oTarget.addEventListener(sEventType, fnHandler, false); } else if (oTarget.attachEvent) { oTarget.attachEvent("on" + sEventType, fnHandler); } else { oTarget["on" + sEventType] = fnHandler; } } function InitRFPos() { addEventHandler(ActiveRFPos, "ProcStepChange", ProcStepChange); //ActiveRFPos.CommName = 'COM3'; ActiveRFPos.MerchID = '1003'; ActiveRFPos.MerchName = '广州百佳超市正佳广场店'; ActiveRFPos.OperID = 'JFY'; ActiveRFPos.OperName = '教富有'; if ( ActiveRFPos.HandleRFPos('CONNRFPOS', 0, 0, '') == '' ) { window.top.opener=''; window.close(); } } 我的ACTIVEX是用DELPHI开发的,我用跟踪调试的试可以看到,addEventListener这个被执行了,ACTIVEX控件收到了这个赋值的消息,但是是提示“找不到成员”,好象就是说控件中没有这个事件,为什么啊? 这个控件在IE内核中运行是没有问题的 Delphi代码: procedure TRFPos.EventSinkChanged(const EventSink: IInterface); begin inherited; FEvents := EventSink as IRFPosEvents; inherited EventSinkChanged(EventSink); end; procedure TRFPos.ProcStepChangeEvent(const StepMsg: String); begin if FEvents <> nil then FEvents.OnProcStepChange(StepMsg); end; |
|
1楼#
发布于:2008-12-19 13:32
最终解决办法,装个IETAB插件
不能涉望FF支持ACTIVE比IE还好 |
|
2楼#
发布于:2008-12-19 13:32
Firefox能直接调用ACTIVEX控件?
|
|
|
3楼#
发布于:2008-12-19 13:32
我用单步执行的方式,可以看到执行到了
FEvents := EventSink as IRFPosEvents; 但是在inherited EventSinkChanged(EventSink); 后,就提示“找不到成员” |
|