有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

com JACOB java lib,调用函数时运行ActiveX对象获取错误灾难性失败

我正在尝试使用ActiveX COM对象库ocx来控制java中的摄像头

我曾尝试使用JACOB lib调用lib,但调用任何函数甚至put时出现以下错误:

run:
The Library been loaded, and an activeX component been created
The Library been loaded, and an activeX component been created
Exception in thread "main" com.jacob.com.ComFailException: A COM exception has been encountered:
At Invoke of: EnablePTZ
Description: 8000ffff / Catastrophic failure

    at com.jacob.com.Dispatch.invokev(Native Method)
    at com.jacob.com.Dispatch.invokev(Dispatch.java:625)
    at com.jacob.com.Dispatch.callN(Dispatch.java:453)
    at com.jacob.com.Dispatch.call(Dispatch.java:529)
    at au.com.ricor.ACTICamWrapper.<init>(ACTICamWrapper.java:39)
    at au.com.ricor.CameraPanel.main(CameraPanel.java:56)

JACOB代码的实现如下所示:

  //Loading the library:
    ActiveXComponent ACTICam = new ActiveXComponent("NVUNIFIEDCONTROL.nvUnifiedControlCtrl.1");     
    System.out.println("The Library been loaded, and an activeX component been created");

        ActiveXComponent xmlhttp = new ActiveXComponent("Microsoft.XMLHTTP") ;
        System.out.println("The Library been loaded, and an activeX component been created");

        String strURL = "http://192.168.1.100:80" ;
        strURL = strURL + "/cgi-bin/system?USER=Admin&PWD=123456&SYSTEM_INFO";
        Dispatch.call(xmlhttp,"Open","get",strURL, false);
        Dispatch.call(xmlhttp,"setRequestHeader","Content-Type", "application/x-www-form-urlencoded");
       // Dispatch.call(xmlhttp,"send");

        int test = 1;
        //configure Camerra and connection
        //Dispatch.call(ACTICam,"SetControlActive", true);
        //Dispatch.put(ACTICam, "CodecType",5);
        //Dispatch.put(ACTICam, "MediaType",1);
        //Dispatch.put(ACTICam, "ID",5);
        Dispatch.call(ACTICam, "EnablePTZ");
        Dispatch.call(ACTICam, "PTZIris","AUTO");
        Dispatch.call(ACTICam, "PTZDayNight","ON");
        Dispatch.put(ACTICam, "MediaSource","192.168.10.242");
        ....

注意,我尝试了另一个AciveX对象,看看是否可以调用这些函数,似乎我可以

你知道发生了什么,至少我可以进一步调试它吗


共 (0) 个答案