cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API Java CallFunction return object cast error

SMAINIL
Super Contributor

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

1 Reply

alao
New Contributor

Try casting to MegaCOMObject