On Jul 17, 2007, at 1:24 PM, j impala wrote:
Hi Timothy,
thanks for looking into this, and most importantly thanks for that
amazing work you're putting into JNA. I think it is high quality.
Your remark was helpful as I had not understood that JNA actually
makes use of the contiguitiy of the Java array.
Your suggestion, however, won't work. In fact, contrary to what you
write, I am not even accessing the second element of the array in
the C test code. I would like to, of course, but hadn't yet done so.
So there must be something else going on. An idea ?
Given that your code fails when it tries to print the "name" field,
that would suggest that the name field is not properly initialized.
You declare it as a Pointer, but you don't show how it is initialized.
Windows will crash if you do a %s with a null pointer.
You should define it as the appropriate String type (String or
WString, depending on whether TCHAR is char or wchar_T), and just
assign it a normal Java string.