Is it possible to use the following JNI:
public NativeClass {
static {
System.loadLibrary("dll");
}
public static native void addListener(Listener listener);
}
public interface Listener {
public void eventOccurred(Info info);
}
public Info {
private final String s1;
private final String s2;
public Info(String s1, String s2);
}
Is it possible
- register object
Listeneron dll (it should be no problem as far as i found out) - to create an instance of an object
Infoin c / C ++ code and use it as a parameter to call Listener.eventOccured(Info...)?
Or what would be a good way to implement a listener that receives some information from a DLL?
In my case, we have a dll that does some work. We call this dll from java. Now we want to attach the listener to the DLL in order to push us to some progress information. The above example is the part of the listener that I donβt know if it is possible with respect to calling the constructor of the Java constructor from c / C ++.
, , , - , .
, c/++, :)