我正在尝试通过在Java中使用jacob访问activeX函数。 我从注册表项中获得了ActiveXComponent。我必须调用一种方法。
try{
ActiveXComponent activeXComponent = new ActiveXComponent("ACTIVEX.ActiveXCtrl.1");
System.out.println("The Library been loaded, and an activeX component been created..");
String filename1 = Dispatch.call(activeXComponent, "getFaceTemplFromFile","test.jpg").toString();
String filename2 = Dispatch.call(activeXComponent, "getFaceTemplFromFile", "test2.jpg").toString();
System.out.println( Dispatch.call(activeXComponent, "compareFaceEx",filename1,filename2 ).toString());
}
catch (Exception e){
e.printStackTrace();
}
我遇到了雅各布错误““ com.jacob.com.ComFailException:遇到了COM异常:”。
com.jacob.com.ComFailException: A COM exception has been encountered:
At Invoke of: getFaceTemplFromFile
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:541)
at ActiveXTest.main(ActvieXTest.java:29)
ActiveXComponent仅提供功能列表。 [在此处输入图片描述] [1] 有没有办法使用提供的功能?我不确定。 请帮我解决。谢谢。