JNI .NET – Java calling C++ .NET

Three weeks ago I presented in SUN’s java technology day. I show interoperability between .NET and java in several ways- JNI (java native interface), DB (shared database), SOA (web services intergration), and open standards (with OPENXML).


Some people asked me to share the JNI code I demonstrated because there is very little documentation and examples out in the web of java calling C++ managed code, especially using visual studio 2005 and orcas.
This is a simple example of java application calling a native C++ dll and a managed C++ dll.
All you need to do is to download the files and follow the 1-5 instructions:

Installation:

1)Download the .NET and Java examples
2)Open the .NET solution and build it using visual studio 2005 or orcas.
3)In the java code (MyJNICall.java) reset the path to the location of the DLLs in your local disk.
4)Build the java code
5)Run the java application