2 messages in net.java.dev.jna.userszero-terminated String conversion
FromSent OnAttachments
Vito IngrassiaAug 8, 2007 9:04 am 
Timothy WallAug 8, 2007 9:45 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:zero-terminated String conversion Actions...
From:Vito Ingrassia (v.in@iwbank.it)
Date:Aug 8, 2007 9:04:10 am
List:net.java.dev.jna.users

Hello,

my C callback function is

void Function(const AType* val);

where AType is

typedef char AType[15];

I mapped the C Function in java

void Function(String val);

but the passed String isn't zero-terminated.

If I try to use this mapping

void Function(byte[] val);

I get a runtime exception saying I need a custom conversion.

Where is the problem and how can I fix it? How to add a custom conversion?

thanks

Vito

IW Bank S.p.A. is an authorised Bank in Italy."