Posted by xions
on March 20, 2008 at 3:23 AM PDT
I try to access a instance member field of a Java class using the K Native Interface (KNI) from C++. Im using phoneME feature and try to extend the VM to support RS232. My code looks as follows:
/* Declare handle */
/* Get "this" pointer */
/* Get instance class */
KNI_GetObjectClass (objectHandle, classHandle);
/* Get field id(s) */
jfieldID fidFD = KNI_GetFieldID (classHandle, "_fd", "I");
if (fidFD == NULL)
KNI_ThrowNew ("java/io/IOException", "Could not get field id");
/* Establish connection and set field _fd
* using KNI_SetIntField ( ... )
What really confuses me is the fact, that the same code already worked using the old kvm (j2me_cldc) from sun.
Hope somebody can help me with this.
Thanks in advance