COM wrapper for Java

Hi,is it possible to wrap a java class as a COM component (without using MS VM) so that it is available to VB and other programs which can use COM Components.Also are there any freeware products which help in doing thisThanks in advance,Ramkumar
[287 byte] By [SRamkuma] at [2007-9-26 3:28:17]
# 1
Hi!Take a look at the link below. It's maybe what you're looking for? http://java.sun.com/products/javabeans/software/bridge/RegardsJohan
joka at 2007-6-29 11:51:49 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
Hi!BTW. I have tested it and it works fine. Also, it's free. Actually, it's part of the JDK now, from v 1.2 I think.RegardsJohan
joka at 2007-6-29 11:51:49 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
is it possible to pass a structure from an external application say a vb application to this bean component?is there any samples available for this?Thanks in advance,Ramkumar
SRamkuma at 2007-6-29 11:51:49 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4

Hi!

As I understand it, you could for example have a JavaBean that have a method setValue(SomeObject a). You should alse be able to send events between the VB app and the JavaBean. You could for example listen to when a VB button gets clicked in your Java code.

Regards

Johan

joka at 2007-6-29 11:51:49 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 5

Not directly.

So-called primitive data types and some types of

arrays can be passed through the bridge. These

primitive types are the ones that are basic Variant types.

Structures (as defined by sth similar to struct)

cannot be passed since they are not ole automation compatible, a COM criterion. Makes sense, too, since what would your Java code do with it? Transform it into a class with fields? Use it as a byte array?

For passing complex data types: either use COM classes and create JCW (java callable wrapper) wrappers for them so that they can be used by your Java code (-> here I recommend the tool JacoZoom by InfoZoom,

check out http://www.infozoom.de)

or write some JNI code to translate the struct into an instance of a corresponding class that you defined to match the structure of the struct.

Sylvia

schleute at 2007-6-29 11:51:49 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 6

Johan,

is there any samples available where a bean is utilized in Visual Basic?

Also how exactly does this work?

I create bean fine(still reading up on it) but then what?

Any links or pointers on where to get the information for proceeding is highly welcome.

Thanks in advance,

Ramkumar

SRamkuma at 2007-6-29 11:51:49 > top of Java-index,Java HotSpot Virtual Machine,Specifications...