|
Re: Native C string (char*) to java String
I don't see a killer bug, but there is one thing to clean up.
1) Each call to Pointer.createStringBuffer() essentially "mallocs" a new C string buffer, so you typically need to free it after calling the C function (unless the C code stashes the value somewhere to use later). To fix this, create a local Pointer variable, say "ptr", and call ptr.free() after the call out to C.
Also, I'm not sure what died, and what the symptoms are. Something on the cRIO or the driver station?
And I couldn't find the C code for ZomBDashboardGetString(), etc. Is it in the svn somewhere?
Good luck!
|