Menu

How to call a function which accepts enum as parameter using j-interop.

Dilip Rai
2018-03-27
2018-05-13
  • Dilip Rai

    Dilip Rai - 2018-03-27

    We have a requirement where we want to call COM function using J-Interop.
    But we are not able to call that function because the function takes below two parameter
    1.BSTR ID,
    2.EnumDSSObjectType Type,
    We can pass String type(1) but for enum type(2) we don't know how to pass value.

    When we are invoking below call we are getting TypeMismatch Exception with error code 0x80020005.
    "callMethodA("FindObject",new Object[]{new JIString("XXXXXXXXXXXXXXX"),3)"
    From JIAutomationException we are not able to get the sufficient information why this error happened.
    So can you suggest some way to pass the enum type as argument in j-interop?

    Please let us know if you have any terms and conditions to help us resolve this.

     
  • Justin Megawarne

    This is almost certainly an int or a long. Pass it in as an integer type.

     

Log in to post a comment.