JNI: calling java
From: Thomas Smith (thomas.smith_at_cox.net)
Date: 10/08/04
- Next message: Thomas Smith: "Re: Seeking very user-friendly, drag-and-drop GUI design tool."
- Previous message: IchBin: "Re: installer recommendation?"
- Next in thread: Thomas Smith: "Re: calling java"
- Reply: Thomas Smith: "Re: calling java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 8 Oct 2004 16:31:27 -0400
I am having a bear of a time making a return call from C++ back to a java
Object.
I keep getting a NoSuchMethod Exception. Unfortunately, I see different
possible signatures in several different articles.
Can anyone out there give me a definitive answer on this?
here is the java Code:
public class CPlusPlusTest {
static{
System.loadLibrary("JNITest");
}
public void callMe(){
System.out.println("java was called");
}
public native void doHello();
public static void main(String[] args) {
new CPlusPlusTest().doHello();
}
}
and here is the C++ code:
VOID Java_com_ts_jni_play_CPlusPlusTest_doHello
(JNIEnv * env, jobject jObj){
printf("do hello called natively");
jclass cls=env->GetObjectClass(jObj);
if(cls==0) printf("class not found");
}
-- Thomas W. Smith Senior Engineer
- Next message: Thomas Smith: "Re: Seeking very user-friendly, drag-and-drop GUI design tool."
- Previous message: IchBin: "Re: installer recommendation?"
- Next in thread: Thomas Smith: "Re: calling java"
- Reply: Thomas Smith: "Re: calling java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|