现在我有个C++写好的dll,打算用JNI来调用,看了网上的资料。首先先写Java代码,然后用javah命令,最后在jni中调用调用已经存在的dll函数。现在遇到java类型转换的问题。
现在有个函数
jcu_user_handle_t* jcu_net_login(
char *ip,
unsigned short port,
char *user,
char *pass,
int timeout,
jcu_event_cb_t *event_cb,
jcu_notify_cb_t *complete_cb);
其中参数jcu_event_cb_t类型为
typedef struct _jcu_event_cb_s{
void *user_arg;
int (*callback)(struct _jcu_event_cb_s *handle,jcu_cb_parm_t *parm);
}jcu_event_cb_t;
其中参数jcu_cb_parm_t类型为
typedef struct _jcu_cb_parm_s{
int id;
int args;
int size;
char *data;
}jcu_cb_parm_t;
其中参数jcu_cb_parm_t类型为
typedef enum _JCU_EVENT_ID_E {
int is_sync;
void *user_arg;
int (*callback)(struct _jcu_notify_cb_s *handle, jcu_cb_parm_t *parm);
}jcu_notify_cb_t;
求各位大神指点一下类型应该如何转换?