jstring to L_TCHAR* format
- by Ayusman
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