PDA

Click to See Complete Forum and Search --> : Using VB COM objects in Java?


JoeyCode
Feb 12th, 2001, 07:09 PM
Does anyone know of a way or a utility that allows VB6 COM objects (like an ActiveX DLL) to be used from a Java app?

I'm developing a stand-alone utility that supports a fairly large Java application. I figured I'd put all of the functionality into a DLL, and then just add a simple VB interface to it, thus allowing flexibility and other programs to use the DLL if desired. But apparently using COM from Java isn't as easy (or as possible) as I hoped (I don't know much about Java in general).

I believe the Java app is being written with Sun's latest SDK, I don't know what IDE is being used (if it even matters). Any help or guidance is appreciated.

Thanks,
-JoeyCode

Feb 15th, 2001, 09:38 AM
Trail: Java Native Interface: Table of Contents
http://java.sun.com/docs/books/tutorial/native1.1/TOC.html

JoeyCode
Feb 19th, 2001, 06:20 PM
Thanks VirtuallyVB, but that link describes how to set up Java code to use it from another language, and I need to know how to go the other way and use my VB COM DLL within Java. Any info about that?

Thanks,
-JoeyCode

Feb 19th, 2001, 11:35 PM
Are you sure you read the first section? The HelloWorld example had this form:

class YourJavaClass {
public native void nonJavaMethod();
static {
System.loadLibrary("yourDLL");
}
public static void main(String[] args) {
new YourJavaClass().nonJavaMethod();
}
}

I think you clicked on the link:
Interacting with Java from the Native Side.
and saw how to call Java from a nonJava method.
That's one problem with hyper-links and the information super-highway, it's easy to digress.

Try clicking on the right-ward arrow at the top-left or bottom-left of the screen to follow the steps. They say:
<--- TOC --->