Amitava_Mukherjee
asked on
.Net dll from Java
Hi,
I found numerous links about how C++ / Win32 dll s can be called from Java. Some useful links are given below.
http://sourceforge.net/projects/jawinproject/
https://www.experts-exchange.com/questions/23025774/Java-and-DLLs.html?sfQueryTermInfo=1+10+30+dll+java
etc. etc.
Now my question is can I use .Net dlls from java? If it is possible then how it is possible? I repeat, I am not asking about COM dll, but asking about .Net dlls. Which may be heavily dependent on Framework.
Is it possible? I have not any fair idea about CORBA / JNI. Is this possible in those?
I found numerous links about how C++ / Win32 dll s can be called from Java. Some useful links are given below.
http://sourceforge.net/projects/jawinproject/
https://www.experts-exchange.com/questions/23025774/Java-and-DLLs.html?sfQueryTermInfo=1+10+30+dll+java
etc. etc.
Now my question is can I use .Net dlls from java? If it is possible then how it is possible? I repeat, I am not asking about COM dll, but asking about .Net dlls. Which may be heavily dependent on Framework.
Is it possible? I have not any fair idea about CORBA / JNI. Is this possible in those?
take a look, http://tssblog.blogs.techtarget.com/2007/03/30/interoperability-without-the-network-jni-net-dlls/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, those r nice links which is telling that .Net dlls can be used from Java by JNI. Thanx for that. I really appreciate for those links.
But is there any sample code which demonstrates how to use C# 2008 dll from Java? I am not finding any links, all those are available which are demonstration of how to call C/C++ dlls from java. Please help
But is there any sample code which demonstrates how to use C# 2008 dll from Java? I am not finding any links, all those are available which are demonstration of how to call C/C++ dlls from java. Please help
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
is it? there is no diffrence between C/C++ dll and those dlls generated in C# by "Class Library" type project selection? If I add following two lines in that C# dll
using system.windows.forms;
public void SayHello()
{
MessageBox.Show("Hello", "Test", MessageBoxButton.OK, MessageBoxIcon.Information );
}
compile that in dll, and try to call it from Java, should it work?
Thanx
using system.windows.forms;
public void SayHello()
{
MessageBox.Show("Hello", "Test", MessageBoxButton.OK, MessageBoxIcon.Information
}
compile that in dll, and try to call it from Java, should it work?
Thanx
ASKER
OK, searching in net I have found a usefull (for me atleast) link at the following:
http://www.codeproject.com/KB/java/DebugJavaJNIApplication.aspx
Now as I proceed believing C# dll will work with JNI same as the C++ do, I have stuck out in the following codes of the above link !
#include "NativeAdd.h"
jdouble JNICALL Java_nativegui_NativeAdd_a dd
(JNIEnv *env, jclass cls, jdouble n1, jdouble n2)
{
return n1 + n2;
}
No place to write those lines in C# !! Please help, how this can be done in C#?
Thanx
http://www.codeproject.com/KB/java/DebugJavaJNIApplication.aspx
Now as I proceed believing C# dll will work with JNI same as the C++ do, I have stuck out in the following codes of the above link !
#include "NativeAdd.h"
jdouble JNICALL Java_nativegui_NativeAdd_a
(JNIEnv *env, jclass cls, jdouble n1, jdouble n2)
{
return n1 + n2;
}
No place to write those lines in C# !! Please help, how this can be done in C#?
Thanx
ASKER
THanx