Re: How to call c++ com dll ?



Uli Kunkel wrote:
Arne Vajhøj wrote:
Uli Kunkel wrote:
Roedy Green wrote:
On Wed, 29 Oct 2008 10:39:29 +0100, Uli Kunkel <genijalac@xxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :
I have an SDK for some hardware that is written i c++. It has library's and header files.I would like to make a java applet using it.
I'm wondering if I encapsulate some sdk functions in a COM dll can I then call these functions from an applet??

Thanks in advance for any suggestions.

see http://mindprod.com/jgloss/jni.html

You write some glue, same native functions callable from Java, that
then invoke the API of your com library.

So I can create an MFC DLL project to expose some functions and than write the "glue"?
Will all the library's from the original sdk be embedded in that one dll?

You can not embed a DLL in another DLL. But if you have the LIB then
you can link the code into the new DLL.

Arne

I have another problem.
When I create a test dll, java can call it without any problems.
But when I call other dlls from the "exposed" dll I get the following error "java.lang.UnsatisfiedLinkError" ... "Can't find dependent libraries".
All the dlls are in the same directory.I use System.load() and specify the whole path.

I found the location for my problem.
When in an jni exposed function I call the function that initializes the sdk, than the dll cannot load.
Notice that the error doesn't come up when I call the exposed method!It comes up when I try to load the dll.
.


Quantcast