Open source are the greatest wealth---WANGPENG
posts - 46, comments - 11, trackbacks - 0, articles - 0
   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

[转载]使用Jni生成头文件

Posted on 2009-07-02 22:56 WANGPENG 阅读(468) 评论(0)  编辑  收藏 所属分类: Java

 

现在项目中要使用dll获得当前识币器的状态,返回内容是数值.

status值有以下几种:
0: 正常
1:少纸
2:卡纸
3:缺纸
4:初始化失败
5:其它未知错误

 1 package com.service;
 2 

 3 
 4 public class Callprintinvoice {
 5     public native static int
 getPrintState();
 6     public native static boolean
 printinvoice(String data);
 7     static
{
 8       System.loadLibrary("Hn_Printinvoice"
); 
 9 
    }  
10 
}
11 

12 

编译Callprintinvoice.java为Callprintinvoice.class文件,然后使用javah -jni 包名+class的文件名就可以生成.h头文件


只有注册用户登录后才能发表评论。


网站导航: