4

I'm trying to use an ActiveX COM object library ocx to control a camera in java.

I've try to use JACOB lib to call the lib but I got the following error calling any function or even a 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)

the JACOB code implementation is the following:

  //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");
        ....

Note I've tried another AciveX object to see If I could call the functions and it seem I can.

Any Idea on what is happening, at least how I can debug it further?

Mat
  • 188,820
  • 38
  • 367
  • 383
william pagnon
  • 335
  • 3
  • 16

0 Answers0