关于JNA调用dll函数问题
FunctionCreateBstrCommand(ByValcontrollerSNAsLong,ByValstrFuncDataAsString)AsString这个...
Function CreateBstrCommand(ByVal controllerSN As Long, ByVal strFuncData As String) As String
这个是.net写的函数声明
public String CreateBstrCommand(long controllerSN,String strFuncData);
这是Java写的函数声明
我的dll已经加载了 但是还是报错 找不到函数
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up function 'CreateBstrCommand': 找不到指定的程序。 展开
这个是.net写的函数声明
public String CreateBstrCommand(long controllerSN,String strFuncData);
这是Java写的函数声明
我的dll已经加载了 但是还是报错 找不到函数
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up function 'CreateBstrCommand': 找不到指定的程序。 展开
1个回答
展开全部
public class test {
public static void main(String[] args) {
int dwMachineNumber;
IntByReference dwYear = new IntByReference();
IntByReference dwMonth = new IntByReference();
IntByReference dwDay = new IntByReference();
IntByReference dwHour = new IntByReference();
IntByReference dwMinute = new IntByReference();
IntByReference dwDayOfWeek = new IntByReference();
boolean result = dmapi.INSTANCE.GetAllUserID(dwMachineNumber,dwYear,dwMonth,dwDay,dwHour,dwMinute,dwDayOfWeek);
...
}
}
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Structure;
public interface dmapi extends Library {
dmapi INSTANCE = (dmapi)Native.loadLibrary("dmapi", dmapi.class);
public boolean GetAllUserID (
int dwMachineNumber,
IntByReference dwEnrollNumber,
IntByReference dwEMachineNumber,
IntByReference dwBackupNumber,
IntByReference dwMachinePrivilege,
IntByReference dwEnable
);
}
还有问题上QQ
public static void main(String[] args) {
int dwMachineNumber;
IntByReference dwYear = new IntByReference();
IntByReference dwMonth = new IntByReference();
IntByReference dwDay = new IntByReference();
IntByReference dwHour = new IntByReference();
IntByReference dwMinute = new IntByReference();
IntByReference dwDayOfWeek = new IntByReference();
boolean result = dmapi.INSTANCE.GetAllUserID(dwMachineNumber,dwYear,dwMonth,dwDay,dwHour,dwMinute,dwDayOfWeek);
...
}
}
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Structure;
public interface dmapi extends Library {
dmapi INSTANCE = (dmapi)Native.loadLibrary("dmapi", dmapi.class);
public boolean GetAllUserID (
int dwMachineNumber,
IntByReference dwEnrollNumber,
IntByReference dwEMachineNumber,
IntByReference dwBackupNumber,
IntByReference dwMachinePrivilege,
IntByReference dwEnable
);
}
还有问题上QQ
追问
系
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询