0

I am trying to make face detect and compare code. Now For this project, I am going to use ZZActiveX2.0. So I used jacob to access Active X. I downloaded jacob-1.19 and copyed jacob-1.19-x86.dll to System32 and register jacob-1.19.jar in my java project. I checked applicatio clsid in registry(HKEY_CLASSES_ROOT\ACTIVEX.ActiveXCtrl.1\CLSID(Default)->"{e77e4cc8-e879-4a72-850a-b824742ec5b7}").

import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;

class ActiveXTest {
    public static void main(String[] args) {       
        try {
            ActiveXComponent xl = new ActiveXComponent("{e77e4cc8-e879-4a72-850a-b824742ec5b7}");
            Dispatch xlo = xl.getObject();

        }
        catch (Exception e){
            e.printStackTrace();
        }

    }
}

But This code appears errors such as like following.

com.jacob.com.ComFailException: Can't get object clsid from progid
    at com.jacob.com.Dispatch.createInstanceNative(Native Method)
    at com.jacob.com.Dispatch.<init>(Dispatch.java:99)
    at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58)
    at ActiveXTest.main(ActvieXTest.java:11)

I searched this error and saw Sample Project about Word application. I followed some solutions but it does not work in my project.Someone advised to use regasm or AutoItx but it does not works, too. Have you ever seen this type of errors? Have you have solved this problem?

2 Answers2

0

You must insert regiseterd program name instead of clsid.

 ActiveXComponent activeXComponent = new ActiveXComponent("ACTIVEX.ActiveXCtrl.1");
0

You can use CLSID but with this syntax:

ActiveXComponent xl = new ActiveXComponent("CLSID:{e77e4cc8-e879-4a72-850a-b824742ec5b7}");       
BEingprabhU
  • 1,618
  • 2
  • 21
  • 28