Posted By:
Darrick_White
Posted On:
Wednesday, November 7, 2001 06:23 AM
My question, which inevitably in my eyes has been deemed impossible to answer, is as follows: How can one incorporate MS VM to connect to an MS COM object using Suns JDK 1.3.1? Ive tried the following: I ran the simple example of a COM object with a client interfacing with that COM object that came with MS SDK for Java 4.0. I built the *java files using the given makefile (jvc). I registered the Hub with javareg and created a hub.tlb with jactivex. Using JBuilder 4.0, I built a small non-swing object that created in instance of the Client class from above: import sample.dcom.*; public class Main { public Main() { try { // MS Client the
More>>
My question, which inevitably in my eyes has been deemed impossible to answer, is as follows: How can one incorporate MS VM to connect to an MS COM object using Suns JDK 1.3.1?
Ive tried the following: I ran the simple example of a COM object with a client interfacing with that COM object that came with MS SDK for Java 4.0. I built the *java files using the given makefile (jvc). I registered the Hub with javareg and created a hub.tlb with jactivex.
Using JBuilder 4.0, I built a small non-swing object that created in instance of the Client class from above:
import sample.dcom.*;
public class Main
{
public Main()
{
try
{
// MS Client the Client class creates the COM object connection to HUB
Client client = new Client();
}
catch( Exception exception )
{
System.err.println("Default exception caught");
System.err.println(exception);
exception.printStackTrace();
}
}
}
I was able to compile/make the above snippet of code, but without having access to the com.ms* classes and without loading a library (since the Hub class actually references a native function), I was not able to run my application:
java.lang.UnsatisfiedLinkError: addListener
at hub.Hub.addListener(Native Method)
at sample.dcom.Client.
(Client.java)
at am.temp.Main.
(Main.java:30)
at am.temp.Main.main(Main.java:44)
However, if run the following command: jview Main, I get the necessary results. Which is what I thought would happen. I tried doing the same thing within a swing application, however, to my not-so-surprise, MS doesnt contain swing components. Ive read through many forum headaches: Ive tried appending rt.jar, You cant mix MS with Sun, etc.
Therefore, has anyone had any luck creating/connecting/instantiating a MS COM object while trying to run it under Suns VM? Note: I have to do it this way since the application Im trying to connect to is built as a COM server and Im using Java as my application language.
Thank you.
<<Less