OK, so I've never tried to use JNI before, but I'm giving it a try. My goal here is to be able to invoke a method within a DLL that was written in VB.
I started by going through the JNI tutorial. That was great, but, from what I can tell, it is only possible to interface with a DLL written in C/C++.
I did a bit more research and it looks like it's possible to invoke a method within a VB DLL by creating a C/C++ DLL and having that DLL invoke the method I want to invoke, like this:
It isn't pretty, but it seems to be the only way to really go about this.
So, I've written the following two pieces - first, the Java code:
Next, I wrote the C to create the "wrapper" dll:
This part of it works great - if I try to run my Java application, the method within the C DLL is invoked and the application prints out "Hello world!" to the console.
Now, for the last part. How do I make the C DLL invoke a method of the VB DLL? This definitely goes outside my realm of expertise and I just don't know how to do that. Any help would be greatly appreciated.
Thanks,
Corey
I started by going through the JNI tutorial. That was great, but, from what I can tell, it is only possible to interface with a DLL written in C/C++.
I did a bit more research and it looks like it's possible to invoke a method within a VB DLL by creating a C/C++ DLL and having that DLL invoke the method I want to invoke, like this:
It isn't pretty, but it seems to be the only way to really go about this.
So, I've written the following two pieces - first, the Java code:
Next, I wrote the C to create the "wrapper" dll:
This part of it works great - if I try to run my Java application, the method within the C DLL is invoked and the application prints out "Hello world!" to the console.
Now, for the last part. How do I make the C DLL invoke a method of the VB DLL? This definitely goes outside my realm of expertise and I just don't know how to do that. Any help would be greatly appreciated.
Thanks,
Corey