加载ActiveX对象中的Applet [英] load ActiveX object in Applet

查看:131
本文介绍了加载ActiveX对象中的Applet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个处理从一个专门的麦克风接收的事件和音频的Web应用程序。音频是由在网页上运行的Java小程序处理,但其他事件(麦克风连接,断开麦克风,麦克风按钮pressed)是由一个ActiveX对象处理。

I have a web application that processes events and audio received from a specialised microphone. The audio is processed by a Java applet that runs in the web page, but other events (microphone connected, microphone disconnected, microphone button pressed) are handled by an ActiveX object.

中的ActiveX对象捕获这些事件并调用JavaScript的code来处理它们。

The ActiveX object traps these events and calls JavaScript code to handle them

<!-- Load the ActiveX control -->
<object id="PhilipsSpeechMikeCtrl" width="0" height="0" tabindex="-1"
    classid="CLSID:AAA44754-CC81-4692-91AF-7064E58EB22A"
    standby="Loading Philips SpeechMike component..."
    type="application/x-oleobject">
</object>

<script type="text/javascript">
    // This is Microsofts javascript way of trapping ActiveX object events.

    function PhilipsSpeechMikeCtrl::SPMEventDeviceConnected(deviceID) {
        // Call JavaScript code to handle the microphone connected event
    }

    function PhilipsSpeechMikeCtrl::SPMEventDeviceDisconnected(deviceID) {
        // Call JavaScript code to handle the microphone disconnected event
    }

    function PhilipsSpeechMikeCtrl::SPMEventButton(deviceID, eventId) {
        // Call JavaScript code to handle the microphone button pressed event
    }
</script>

当然,这种方法的一个问题是,它是完全依赖于IE浏览器。我会有preFER的小应用程序内加载ActiveX对象,陷阱的事件和处理来自小程序调用的事件无论是小程序中,或JavaScript code。那么这将使我跑在支持小程序的任何浏览器的应用程序。

Of course a problem with this approach is that it's completely IE dependent. I would prefer to load the ActiveX object within the applet, trap the events there and handle the events either within the applet, or JavaScript code called from the applet. This should then enable me to run the app in any browser that supports applets.

我不完全知道如何去实施解决方案我上面提出的,有什么建​​议?

I'm not entirely sure how to go about implementing the solution I've proposed above, any suggestions?

更新:我知道我上面提出的仍然是IE依赖的解决方案,这很好。我的近期目标是支持Windows所有浏览器。

Update: I realise the solution I've proposed above would still be IE dependent, that's fine. My immediate goal is to support all browsers on Windows.

有人建议,与其使用ActiveX,我可以使用JNI(或JNA)访问ActiveX对象背后的DLL文件。不过,我并不真的想调用的函数的DLL文件,我想这些DLL给我打电话,也就是注册一个事件处理程序。

It has been suggested that instead of using ActiveX, I could use JNI (or JNA) to access the DLLs underlying the ActiveX object. However, I don't actually want to call the functions in the DLLs, I want the DLLs to call me, i.e. register an event handler.

谢谢,

推荐答案

ActiveX是不是由其他浏览器比IE的支持,所以没有办法为你的应用程序支持所有的浏览器,甚至仅适用于Windows。
火狐1下的一个尝试(插件)端口的ActiveX被做了,但没有真正有用的,以便据我所知,今天没有仿真的解决你的问题。
抱歉...
(请参见这里 Mozilla的评论)

ActiveX are not supported by an another browser than IE, so there is no way for your application to support all browsers, even on Windows only. An attempt (plugin) to port ActiveX under Firefox 1 was made, but wasn't really useful so as far as I know, there is today no "emulation" solution to your question. Sorry... (see here for Mozilla comments)

这篇关于加载ActiveX对象中的Applet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆