Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Native windows dll access problem from PlugIn
Native windows dll access problem from PlugIn [message #318496] Tue, 31 July 2007 07:39 Go to next message
Eclipse UserFriend
Originally posted by: pzabawa.poczta.onet.pl

I would like to make use of sun JNA library to communicate to my C++ dll.
The communication works perfectly when I load and call the dll from a Java
project (Java Application). However when I do the same from my Eclipse
PlugIn the library does not load and the plugin hungs during this process.
What shall I do step by step to be able both to load dll and call
functions from it from Eclispe PlugIn?
Thank you in advance.
Piotr
Re: Native windows dll access problem from PlugIn [message #318505 is a reply to message #318496] Tue, 31 July 2007 11:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Piotr,

You posted this same question on the SWT newsgroup separately. Please
don't do that. If you must post to multiple newsgroups, please do so
with a single posting addressed to all the groups so that an answer on
one group appears on all groups. Someone already tried to answer your
question on the other newsgroup...


Piotr wrote:
> I would like to make use of sun JNA library to communicate to my C++
> dll. The communication works perfectly when I load and call the dll
> from a Java project (Java Application). However when I do the same
> from my Eclipse PlugIn the library does not load and the plugin hungs
> during this process. What shall I do step by step to be able both to
> load dll and call functions from it from Eclispe PlugIn?
> Thank you in advance.
> Piotr
>
>
Re: Native windows dll access problem from PlugIn [message #318517 is a reply to message #318505] Tue, 31 July 2007 12:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pzabawa.poczta.onet.pl

OK, sorry for the mess.
Piotr
Re: Native windows dll access problem from PlugIn [message #319623 is a reply to message #318496] Tue, 28 August 2007 12:57 Go to previous message
Eclipse UserFriend
Originally posted by: gerold.broser.easyklick.com

Piotr:
> I would like to make use of sun JNA library to communicate to my C++
> dll. The communication works perfectly when I load and call the dll from
> a Java project (Java Application). However when I do the same from my
> Eclipse PlugIn the library does not load and the plugin hungs during
> this process. What shall I do step by step to be able both to load dll
> and call functions from it from Eclispe PlugIn?
> Thank you in advance.
> Piotr

Hi Piotr,

1. It is called JNI (Java Native Interface ;)

2. A C wrapper DLL is useful, since it is like Matthew mentioned: the functions have to be named specially. I created a
separate Eclipse C project to create this DLL.

3. One (or more) Java wrapper class(es) is/are helpful, since the function names in the C wrapper DLL are derived from
the package structure + wrapper class name + method name + arguments. I put the Java wrapper class(es) in a separate
Eclipse plugin project, and defined this project as dependency of my main plugin project.

4. http://java.sun.com/docs/books/jni/html/preface.html and http://www.codeproject.com/java/jnibasics1.asp are good
starting points.

Regards, and good luck!
Geri
Previous Topic:Builders, Markers and Natures, but not with Resources
Next Topic:ProgressView
Goto Forum:
  


Current Time: Fri Jul 19 14:25:25 GMT 2024

Powered by FUDForum. Page generated in 0.03999 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top