6 messages in net.java.dev.jna.usersRe: [jna-users] Reading string from U...
FromSent OnAttachments
Johan LundMay 15, 2009 6:46 am 
Daniel KaufmannMay 17, 2009 7:22 am 
Johan LundMay 17, 2009 8:19 am 
Johan LundMay 17, 2009 8:22 am 
Daniel KaufmannMay 17, 2009 9:17 am 
Timothy WallMay 17, 2009 9:17 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:Re: [jna-users] Reading string from UnionActions...
From:Johan Lund (joh@risken.se)
Date:May 17, 2009 8:19:50 am
List:net.java.dev.jna.users

These are my native calls!

AdkLibrary.ADK_DATA adkData=aw.createAdkData(); aw.printError(aw.AdkSetSortOrder(adkData, AdkLibrary.ADK_SORT_ORDER.eArticleNr)); AdkLibrary.ADK_ERROR e=aw.AdkFirst(adkData); while(e.lRc==aw.ADKE_OK){ System.err.println(aw.getAdkStr(adkData, aw.ADK_ARTICLE_NUMBER)+" "+aw.getAdkStr(adkData, aw.ADK_ARTICLE_NAME)+" "+aw.getAdkStr(adkData,aw.ADK_ARTICLE_NAME_X)+" "+aw.getAdkDouble(adkData, aw.ADK_ARTICLE_PRICE)); }

This loop runs for about 100 times but always fails after a while...

Actually I haven't checked the size in Java corresponds to the C size, cause I don't know how to actually print the size... Help!

And I still don't understand how to insert that byte[] code trick, cause everytime I try to insert it, the program fails at once. Shall I add it as a public member to the Union and initialize it within the default constructor of the union? Help!

I've also tried to use the setType method of the Union, but I don't know the type of each union until I've called aw.createAdkData(); So what I did was looping through each ADK_FIELD inside the ADK_DATA and setType to String.class on each one containing a String and to IntegerType.class on int Unions. Is this correct? The program doesn't work better, but when I read the documentation it seemed to be the solution...

/Johan