jstring to L_TCHAR* format

Posted by Ayusman on Stack Overflow See other posts from Stack Overflow or by Ayusman
Published on 2010-05-01T01:06:44Z Indexed on 2010/05/01 1:07 UTC
Read the original article Hit count: 302

Filed under:
|

Hi All, I have been trying to call a C function that has the following signature

int changeFoo(L_TCHAR* pszFileSrc){....}

in my JNI call my method looks like this: JNIEXPORT jint JNICALL Java_com_me_L_AFoo (JNIEnv * env, jclass jclass, jstring pSrc) { jint retValue = -100; retValue = changeFoo(pSrc); return retValue; }

I get the following error in visual studio.

Error 1 error C2664: 'L_FileConvert' : cannot convert parameter 1 from 'jstring' to 'L_TCHAR *' c:\Ayusman\Work\MyVCpp\LTExampleDll\LTExampleDll\LTExampleMain.cpp 46 LTExampleDll

When I looked at the definition of L_TCHAR *

here is what I got in the header files (in that sequence):

typedef TCHAR L_TCHAR; typedef WCHAR TCHAR,*PTCHAR; typedef wchar_t WCHAR; //wc, 16 bit UNICODE char

I work on java, this is a JNI application that I am trying to build. Can any body help as to how can I convert this properly?

Thanks, Ayusman

© Stack Overflow or respective owner

Related posts about jni

Related posts about java