还是关于Dll文件调用的问题(我是菜鸟,希望各位不要扔砖)
我看过许多JNI和调用Dll文件方面的帖子,大多是dll文件是作者自己写的,然后利用JAVA调用。
我现在遇到的问题是:第三方提供了一个DLL文件和一个VB/VC调用的例子,方法名都有了。
但是我该怎么老是调用失败呢?这个dll文件已经注册过了。。。
public class mongategsm
{
public native int fnInitModem(int comx);
public native int MongateInitModem(String password);
public native int MongateSendSms(int PortNo,String sn,String mobi,String note);
public native int MongateGetSendCount(int PortNo);
public native int MongateGetRecvCount(int PortNo);
public native int MongateClearSendBuff(int PortNo);
public native int MongateClearRecvBuff(int PortNo);
public static native String[] MongateGetSms(int PortNo);
public native int MongateSetReceive(int PortNo);
public native int MongateGetStatus(int PortNo);
public native int MongateGetPortMax();
public native int MongateCloseModem(int PortNo);
static
{
System.loadLibrary("MonDem");
}
public static void main(String args[])
{
mongategsm tmp=new mongategsm();
if(tmp==null)
{
System.out.println("=========error");
}
if(tmp!=null)
{
System.out.println("=========success");
}
}
}
各位兄弟有更好的方法吗?