mercredi 12 septembre 2018

LeanFT: Unable to invoke methods with non-primitive parameter: No object is registered with cookie: [object Object]

I'm trying to invoke a method on a NativeObject, e.g.:

nativeObject.invokeMethod("scrollRectToVisible", new DynamicObjectProxy(new Rectangle()));

I came up with the idea to pass a DynamicObjectProxy as a method parameter as the "invokeMethod"-method of a NativeObject always returns a DynamicObjectProxy for non-primitive return types.
However, the following exception arrises:
com.hp.lft.sdk.GeneralLeanFtException: no object is registered with cookie:[object Object]

Invoking methods with primitive parameters works fine. If I pass the real object as a parameter, e.g.:

nativeObject.invokeMethod("scrollToRectVisible", new Rectangle());

The following exception arrises:

com.hp.lft.sdk.GeneralLeanFtException: Typeconflict (HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

I would highly appreciate any suggestions.

Aucun commentaire:

Enregistrer un commentaire