Original Post
first a little about my project, to get things in context. it is a game engine, written in c++ (for speed, and good access to DirectX, etc) but "scriptable" using Java, in a similar way to the Unreal Engine with its unrealscript [except that unrealscript sucks hairy ass compared with true java)...
I am using jdk1.2.2 [mainly because of my slow 56k connection and its 20mb smaller than the latest], J2SE. Most things seem to work fine, for example, i can call native methods, and they can call java methods back, and i can keep references to java objects as jobjects, tagged with NewLocalReference(), and all this works.
However, i have noticed that when i try to call a method on a *stored* object for which i havent remembered the jclass variable, method calls suddenly start failing with the Runtime kicking me out, saying that im using an invalid method ID with the object.
I have traced this a good way, and found that while i can find a class correctly using the JNI FindClass(UTFString) function, when i try to retrieve the class of an object using GetObjectClass(jobject), i get a zero result, which is clearly not a class ID. things then begin to fail because I can''t find methodIDs from a zero-class.
What is wrong with:
- the GetObjectClass function, or
- [more likely] my code, that may be causing this?
Thanks in advance.
Chris Forbes