I am in need to multiple values from a method.
A status code (int) and a return value (double).
From what I have read -- it is customary to use an object array to handle this, since java does not support out parameters.
When I return the Object[] through JNI as a jobjectArray how do I obtain(cast) the values as int and double???
This is how I am getting the values from the array via JNI. However the cast to jint does not work as expected.
jsize numOfObjects = m_env->GetArrayLength(attrReturnArray);
if ( numOfObjects >= 2 )
{
jint status = (jint)m_env->GetObjectArrayElement(attrReturnArray, 0);
jint retValue = (jint)m_env->GetObjectArrayElement(attrReturnArray, 1);
}
Any sugestions?