[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.equinox] Re: Using COM via JNI leads to class not registered exception

I recall it may have something to do with threads, that is, when initialization and usage occur in different threads. Sorry I do not have more detail.

Dmitry

On Mon, 13 Jul 2009 14:16:52 +0700, Tobias Koetter <tobias.koetter@xxxxxxx> wrote:

Hi,
I'm using com4j to use a COM dll written in C# from java. Using the COM interface in the main method of a java application works. If I'm using the same com4j methods in an eclipse plugin the following exception in the native C++ code of the com4j dll occurs: "80040154 CoCreateInstance failed : Class not registered" (com4j.cpp line 135).


What I have tryed so far:
Using the C# COM interface in a java main class using com4j->works
Using other existing COM interfaces written in C++ via com4j in an eclipse plugin->works


Placing the dll that implements the COM interface in the root path of the plugin-> does not work
Using Bundle-NativeCode in the manifest to include the com4j and COM interface dll-> does not work


I have also tryed another java<->com bridge JACOB that showed the same behaviour. Works in a java main but not in an eclipse plugin.

Why does it work in a java application but not in an eclipse plugin? What is the differences using jni in a java application and in an eclipse plugin? Why does the com4j native code finds the COM interface in the registry and the eclipse plugin does not?

Thanks a lot for your help!




-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/