JAVA读取DLL,使用jacob-1.18读取ERP LN得dll脚本

来源:互联网 发布:游戏神作 知乎 编辑:程序博客网 时间:2024/06/01 20:32

1.对应得jacob-1.18.dll放到jdk/jre/bin路径下(jdk项目)

2.对应得jacob-1.18.dll放到tomcat/bin下(tomcat项目)

3.放到windows/system32下(不必须),注册

4.运行 dcomcnfg ,找到Baan.Application.47相关名称 属性-标识 改为交互式

5.tomcat服务 - 属性 - 登录 - 以下账户登录 改为管理员登录

4.相关代码

public class Test {    public static void main(String[] args) {        //Baan.Application.47  BECS得ClassName        ActiveXComponent bw = new ActiveXComponent("Baan.Application.47");        //call=0 连接成功        //ParseExecFunction 默认        //owhinrdll90001 脚本dll名称 o wh inr dll90001        //approve.sfc.wh.order.line(..) dll中得方法        //NJR045866 1 2 1  方法参数        Variant call = Dispatch.call(bw,"ParseExecFunction","owhinrdll90001",                "approve.sfc.wh.order.line(\"NJR045866\",\"1\",\"2\",\"1\")");        //   property返回结果值        Variant property = bw.getProperty("ReturnValue");        System.out.println("property"+property);    }}
原创粉丝点击