COM api call from java using Jinterop

1

I am using jinterop as dcom bridge . Using CLASSID i am able to create com object.

// Create a session
    JISession session = JISession.createSession("domain", "user",
            "password");
    session.useSessionSecurity(true);
    // JISystem.setAutoRegisteration(true);
    JIComServer comServer = new JIComServer(
            JIClsid.valueOf("E4BE20dd4-9F1-4B05-9117-AFB4B295"),
            "ipaddress", session);

    // Instantiate the COM Server
    IJIComObject comObject = comServer.createInstance();

    IJIDispatch ieObjectDispatch = (IJIDispatch) JIObjectFactory
            .narrowObject((IJIComObject) comObject
                    .queryInterface(IJIDispatch.IID));
    IJITypeInfo typeInfo = ieObjectDispatch.getTypeInfo(0); 
    FuncDesc funcDesc = typeInfo.getFuncDesc(0);
 JICallBuilder callObject = new JICallBuilder (true);
      callObject.setOpnum (0);
      callObject.addInParamAsString(new String("API"),JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
      callObject.addOutParamAsObject(IJIComObject.class,JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);

      Object[] result = ieObjectDispatch.call ( callObject );

My question is i don't have info of IDL file (Because it is a third party COM), So how i can set value of callObject.setOpnum (0) ?

NOTE: Even if i am using call method , i am getting Unknown name [0x80020006] error. example: JIVariant[] results = ieObjectDispatch.callMethodA("COM API name",params);

Please help me..

Thanks, Amit

java
com
j-interop
asked on Stack Overflow Nov 28, 2012 by user1859789 • edited Nov 28, 2012 by user1859789

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0