Hi, I am using JNA to access a custom DLL which seems to be using the FAR PASCAL Calling Conventions, but the JVM crashes every time i try to access it.
Development Guide of the dll says: BOOL FAR PASCAL GetIomemVersion(LPSTR);
And Dependency Walker tells me: _GetIomemVersion@4
public class PebblePrinter{
public interface Iomem extends StdCallLibrary { boolean _GetIomemVersion(String version); }
String version;
Iomem INSTANCE;
StdCallFunctionMapper myMapper;
public PebblePrinter(){ HashMap optionMap = new HashMap(); myMapper = new StdCallFunctionMapper(); optionMap.put(Library.OPTION_FUNCTION_MAPPER, myMapper); INSTANCE = (Iomem)Native.loadLibrary("iomem", Iomem.class,optionMap); } public String getIomemVersion(){ INSTANCE._GetIomemVersion(version); return version; } }
With C# code it works well using
[DllImport("iomem.dll", EntryPoint = "_GetIomemVersion@4")]
public static extern bool GetIomemVersion(IntPtr version);
Can you tell me what i am doing wrong? Thanks in advance!!!