C++ JNIEnv problem
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Marx_Villegas
Posted On:   Monday, July 24, 2006 12:58 PM

Hi everyone! I'm having a very strange problem when compiling the following C++ method: JNIEXPORT jboolean JNICALL Java_cybercafe_client_view_OSCommandsSupport_lockMachine (JNIEnv *e, jobject jObj, jstring title, jstring password) { HDESK hOriginalThread; HDESK hOriginalInput; HDESK hNewDesktop; //Create title var const char * chTitle; chTitle = e->GetStringUTFChars(title, false); ... etc... the problem is that Visual C++ won't recognize my JNIEnv *e variable as a pointer... The compilation error is the following: WinLockDLL.c(531): error C2223: left of '->GetStringUTFChars' must point to   More>>

Hi everyone!


I'm having a very strange problem when compiling the following C++ method:




			
JNIEXPORT jboolean JNICALL Java_cybercafe_client_view_OSCommandsSupport_lockMachine (JNIEnv *e, jobject jObj, jstring title, jstring password)
{
HDESK hOriginalThread;
HDESK hOriginalInput;
HDESK hNewDesktop;

//Create title var
const char * chTitle;
chTitle = e->GetStringUTFChars(title, false);

... etc...




the problem is that Visual C++ won't recognize my JNIEnv *e variable as a pointer... The compilation error is the following:


WinLockDLL.c(531): error C2223: left of '->GetStringUTFChars' must point to struct/union




Does anyone have a clue about this issue?




Best regards from Caracas Venezuela.

Marx Villegas    <<Less

Re: C++ JNIEnv problem

Posted By:   Nicol_Saraova  
Posted On:   Tuesday, July 25, 2006 01:26 PM

you should give it a try using C syntax:



jboolean iscopy = JNI_NO;

(*env)->GetStringUTFChars(env, s_addr, &iscopy))
About | Sitemap | Contact