We are using jniwrapper to communicate from JAVA with a 3rd party DLL. And the DLL wants us to pass the pointer to a callback function, as an uint64_t.
typedef struct random_struct {
...
uint64_t callback; //!< A function pointer to the callback
..
}
So from the jniwrapper I have tried using Void, Pointer etc to map from Java, but none of those works out. The DLL complains that the callback set up is invalid. So my question is how do I communicate the callback as an uint64_t. Has anyone used Jniwrapper for a requirement like this? Thanks
A proper callback function will be:
Example:
And you can have the following function which will be assigned to the callback:
Then you can assign it in your code: