I am trying to invoke one function of a C# application from Java application using Jacob COM interface. I got the ActiveXComponent from the registry entry. I have to call one method
BaseElement AddItem(
string name,
ElementType type
)
here ElementType is an ENUM
in the C#
application. But I am not able to get the elsemnt type using invokeGetComponent/getPropertyAsComponent.
Interestingly I am able to call the same method as below,
ActiveXComponent appHandler= new ActiveXComponent("Application_name");
ActiveXComponent projectHandler = appHandler.invokeGetComponent("CreateProject", new Variant("C:\\temp"), new Variant("test"));
projectHandler.invokeGetComponent("AddItem", new Variant("item1"),new Variant(0));
This method is doing its duty using integer instead of ElementType but throwing exception
com.jacob.com.ComFailException: A COM exception has been encountered: At Invoke of: AddItem Description: 80004002 / No such interface supported 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.activeX.ActiveXComponent.invoke(ActiveXComponent.java:476) at com.jacob.activeX.ActiveXComponent.invokeGetComponent(ActiveXComponent.java:391)
Is there any ways to get the ENUM type ElementType given in the application ? Seems like the ElementType is in another namespace in C#.