c++ byte[] to jbytearray
843829Jul 3 2006 — edited Jul 12 2006hi, in the c++ code I have a byte array, I need to convert it to jbytearray and call a java method from there.
I'm using this code but the compiler complains about conversions (of course)
jbyteArray jarray = env->NewByteArray(pAdapter->AddressLength);
env->SetByteArrayRegion(jarray, 0, pAdapter->AddressLength, pAdapter->Address);
env->CallVoidMethod(NetDataClassObject, setAddress, jarray);
SetByteArrayRegion' : cannot convert parameter 4 from 'unsigned char [8]' to 'const signed char *'
if I cast pAdapter->Address with (const signed char*) in java I get weirds characters...
here the reference to c++ structs
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iphlp/iphlp/ip_addr_string.asp
Any help? Thanks for attention,
Alessandro