Visual Basic或VBScript作为Java脚本引擎 [英] Visual Basic or VBScript as Java Scripting Engine

查看:148
本文介绍了Visual Basic或VBScript作为Java脚本引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我考虑为Visual Basic或VBScript实现ScriptingEngineàJSR223(因为我不知道任何实现,除了IBM放弃的BSF引擎之外).我知道这将需要一些本机编程,但是我不知道从哪里开始.

I consider implementing a ScriptingEngine à la JSR223 for Visual Basic or VBScript (because I don't know any implementation, except the abandoned BSF engine from IBM). I know it will take me some native programming, but I don't know where to start.

一个想法是将Windows脚本宿主集成到Java中,也许可以像主动控件一样使用它,但是我找不到任何宿主. Windows脚本宿主是否有公共API?还有其他想法吗?

One idea would be to integrate windows scripting host into java, maybe by using it like an active control, but I can't find any. Is there a public API for Windows Scripting host? Any other ideas?

推荐答案

是的,可以将Windows脚本集成到Java中,但这并不简单. Windows脚本界面的文档在MSDN上可用.您最感兴趣的接口是 IActiveScript IActiveScriptParse ,和 IActiveScriptSite .

Yes, it is possible to integrate the Windows Scripting into Java, but it's not trivial. The documentation for the Windows Script Interfaces is available on MSDN. The interfaces you will be most interested in are IActiveScript, IActiveScriptParse, and IActiveScriptSite.

有许多通过Google搜索提供的示例,但在Java中却不多.这些伙计们带有示例,但是使用了有关在.NET中实现这些接口的系列文章.我认为您可能会发现有用的信息.

There are numerous examples available via a Google search, but not many in Java. These guys have examples, but it uses their Java2Com product. While not Java specific, Dr. Dobbs did a series of articles on implementing these interfaces in .NET. I think you may find the information useful.

VB6还附带了一个ActiveX 脚本控件脚本编写到您的应用程序中.在此处中有一个示例,该示例通过Java使用

There was also an ActiveX script control that shipped with VB6, which made it easier to add scripting to your application. There is an example here of using it from Java, utilizing the JACOB Java to COM bridge.

这篇关于Visual Basic或VBScript作为Java脚本引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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