Showing results for 
Search instead for 
Did you mean: 

API Java CallFunction return object cast error


API Java CallFunction return object cast error


I am trying to call a mega function from the java API but the returned object cannot be casted.


I have the following code that works fine in VB:

Dim objReverseEngine
objReverseEngine = mRoot.CallFunction("DbbReverse")

LastTempGenerationPath = objReverseEngine.GetProp("Directory")


I tried the same in java:

MegaObject objReverseEngine = (MegaObject) mRoot.callFunction("DbbReverse");

lastTempGenerationPath = objReverseEngine.getProp("Directory");


But I have the following exception:

com.mega.modeling.api.jni.ComObjectProxy cannot be cast to com.mega.modeling.api.MegaObject


Can you help me to make it works?


Many thanks