如何用JAVA调用WIN32API,解决后马上给分 JIntegra:java com bridgehttp://www.linar.com/ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 建议先封装成dll,再从java中load那个类库,调用其中的方法就可以了。例子:package msgbus;public class EBCallMsgBus{ public static void main(String[] args) { //Load dll library first. System.loadLibrary("MsgBus");//MsgBus.dll EBCallMsgBus EBCallMsgBus1 = new EBCallMsgBus(); String send_id = "UC"; String send_app = "XX"; String resv_id = "LIFE"; String resv_app = "021"; String body = "9999"; String msg_id = ""; String rtn_cd = ""; String[] strRetrun = {"",""}; System.out.println("java start!"); try { System.out.println(System.getProperty("user.dir")); strRetrun = EBCallMsgBus1.MsgBusPut(send_id,send_app,resv_id,resv_app,body); System.out.println("MsgBusPut: [" + strRetrun[0] + "] " + "[" + strRetrun[1] + "]"); if(strRetrun[1].equals("0000")) { msg_id = strRetrun[0]; body=""; rtn_cd=""; strRetrun = EBCallMsgBus1.MsgBusGet(send_id,send_app,resv_id,resv_app,msg_id); System.out.println("MsgBusGet: [" + strRetrun[0] + "] " + "[" + strRetrun[1] + "]"); } } catch (Throwable e) { e.printStackTrace(); } } public native String[] MsgBusGet( String send_id, String send_app, String resv_id, String resv_app, String body); public native String[] MsgBusPut( String send_id, String send_app, String resv_id, String resv_app, String msg_id);} 用Jacob,开放源代码的,在google上搜,我也正在学习中,互相帮助。 Java Tutorial里面Java Native Interface中介绍得很详细了。 关于Arraylist的用法 想做个斗地主的游戏,不知道该如何入手大家一起来讨论下, 给大家推荐一个JAVASCRIPT站点,http://www.tutejs.cn,来这里可以看到很多JAVASCRIPT。 关于JAVA输出图形的问题 急!!!!冒泡排序法的监视哨是什么啊? 那位大虾帮帮忙! 请看这样的参数该怎么传递啊?多谢! 一个response问题 地址传递的问题 java string toCharArray问题 【求助】使用IntelliJ IDEA的几个初级问题!!! Applet运行中更改jButton的Icon属性,有闪烁感,如何用双缓冲或者其他方法去除?
例子:
package msgbus;public class EBCallMsgBus
{
public static void main(String[] args)
{
//Load dll library first.
System.loadLibrary("MsgBus");//MsgBus.dll
EBCallMsgBus EBCallMsgBus1 = new EBCallMsgBus();
String send_id = "UC";
String send_app = "XX";
String resv_id = "LIFE";
String resv_app = "021";
String body = "9999";
String msg_id = "";
String rtn_cd = ""; String[] strRetrun = {"",""};
System.out.println("java start!");
try {
System.out.println(System.getProperty("user.dir"));
strRetrun = EBCallMsgBus1.MsgBusPut(send_id,send_app,resv_id,resv_app,body);
System.out.println("MsgBusPut: [" + strRetrun[0] + "] " + "[" + strRetrun[1] + "]"); if(strRetrun[1].equals("0000"))
{
msg_id = strRetrun[0];
body="";
rtn_cd="";
strRetrun = EBCallMsgBus1.MsgBusGet(send_id,send_app,resv_id,resv_app,msg_id);
System.out.println("MsgBusGet: [" + strRetrun[0] + "] " + "[" + strRetrun[1] + "]");
} } catch (Throwable e) {
e.printStackTrace();
}
}
public native String[] MsgBusGet(
String send_id,
String send_app,
String resv_id,
String resv_app,
String body);
public native String[] MsgBusPut(
String send_id,
String send_app,
String resv_id,
String resv_app,
String msg_id);
}
我也正在学习中,互相帮助。