Data Conversion
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   matthew_smith
Posted On:   Sunday, June 23, 2002 08:49 PM

Does anyone know how to convert a bstr to a jstring.


JNIEXPORT jstring JNICALL Java_JavaCDO_getSubject (JNIEnv *env, jobject)

{

if (aMessagePtr == NULL)

{

return NULL;

}


char * test = NULL;


test = (LPTSTR)aMessagePtr->Subject.bstrVal;


printf("%s",test);


return ((env)->NewStringUTF(test));

}


Matt

Re: Data Conversion

Posted By:   Janak_Janak  
Posted On:   Tuesday, June 25, 2002 12:35 PM

Need to use the NewString() function not NewStringUTF(). NewString() works wil BSTR & wide char strings, while NewStringUTF() is for ANSI characters & UTF8 characters.
About | Sitemap | Contact