cancel
Showing results for 
Search instead for 
Did you mean: 

API Java CallFunction return object cast error

Contributor

API Java CallFunction return object cast error

Hi,

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

 

Stéphane