刚学习java不久,现在要调用C写的动态库..经过一步步研究,终于搞明白了一些东西,比如jni什么的..现在需要调用的C库中有回调函数...如下#define PHONIC_API
#define CALLBACK
.....
.....
.....
typedef void (CALLBACK * ProcPhonicFireEventCallBack)(
EPhonicEvent eventType,
int channelType,
int channelID,
int iParam1,
int iParam2);
//事件通知回调函数
void PHONIC_API tpi_SetEventNotifyCallBackProc(ProcPhonicFireEventCallBack procFireEvent );这些东西在java中如何native声明呢?请高手指点啊!
#define CALLBACK
.....
.....
.....
typedef void (CALLBACK * ProcPhonicFireEventCallBack)(
EPhonicEvent eventType,
int channelType,
int channelID,
int iParam1,
int iParam2);
//事件通知回调函数
void PHONIC_API tpi_SetEventNotifyCallBackProc(ProcPhonicFireEventCallBack procFireEvent );这些东西在java中如何native声明呢?请高手指点啊!
{
static
{
System.loadLibrary("goodluck");
}
public native static int get();
public native static void set(int i);
public static void main(String[] args)
{
testdll test = new testdll();
test.set(10);
System.out.println(test.get());
}
}