AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use a C# dll from Java

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
cirudinezidane@gmail.com
Guest





PostPosted: Tue May 15, 2007 4:10 am    Post subject: Use a C# dll from Java Reply with quote



Hi!

I would like to use a chsarp dynamic library from my Java application.
How I can use all functions from Java? I am beginner in Java but I
read about jni.

Thanks.

Greetings
Back to top
Gordon Beaton
Guest





PostPosted: Tue May 15, 2007 10:37 am    Post subject: Re: Use a C# dll from Java Reply with quote



On 14 May 2007 16:10:27 -0700, cirudinezidane (AT) gmail (DOT) com wrote:
Quote:
I would like to use a chsarp dynamic library from my Java
application. How I can use all functions from Java? I am beginner in
Java but I read about jni.

If you have an existing DLL it doesn't matter what language it was
written in, as long as its functions can be called using C calling
conventions.

To use the DLL from Java, write a set of wrapper methods in C that can
be called from Java according to the rules of JNI, and create a new
DLL from those. From there you can call the functions in the DLL.

i.e. Java => new (JNI) DLL => existing C# DLL

/gordon

--
Back to top
Ian Wilson
Guest





PostPosted: Tue May 15, 2007 2:01 pm    Post subject: Re: Use a C# dll from Java Reply with quote



Gordon Beaton wrote:
Quote:
On 14 May 2007 16:10:27 -0700, cirudinezidane (AT) gmail (DOT) com wrote:

I would like to use a chsarp dynamic library from my Java
application. How I can use all functions from Java? I am beginner
in Java but I read about jni.


If you have an existing DLL it doesn't matter what language it was
written in, as long as its functions can be called using C calling
conventions.

To use the DLL from Java, write a set of wrapper methods in C that
can be called from Java according to the rules of JNI, and create a
new DLL from those. From there you can call the functions in the DLL.


i.e. Java => new (JNI) DLL => existing C# DLL


That's interesting. If I use C# to create MyApp.exe I can't run it on a
PC that doesn't have a CLR installed (.NET, Mono, etc.) This is
obviously because the file MyApp.exe contains CIL not x86 object code.
I've assumed the DLL's produced by C# similarly contain CIL and are not
normal DLLs and also depend on the CLR.

So would that be

Jar/Class => JVM => JNI => DLL(C) => CLR => DLL(C#)

How much of this applies to non-MS platforms using Mono or dotGNU?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.