[java] Intergration with Visual Basic...

Started by
2 comments, last by Joviex 23 years, 7 months ago
I am assuming this is a definate possibility, considering the JNI is 100% COM compliant. However, I have yet to find any resources on the subject, and am wondering if anyone has attmepted anything like this before?? I have played with this idea in C++ and it is great to be able to pass funct. calls back and forth, Java makes for a superior scripting language. So.... I would like to extend it into the Visual Basic area, but seeing as how my COM skills are next to zero, I am looking for some descent papers/tutorials on the subject. Anyone? "Five passengers set sail that day, for a three hour tour, a three hour tour...."
Advertisement
First my opinion (which you are more than welcome to ignore)

I have encountered instances where there was the need to have VB COM components communicate with Java code/beans, but you seem to be proposing using Java as a ‘scripting engine’ for a system written in Visual Basic (maybe I am misunderstanding you?). The list of reasons not to go this route would fill pages of this thread. Unless you just really need to use Java for some reason, you are probably FAR better off using VB or VBScript as your scripting language for your VB system. Microsoft’s VBA and / or the Microsoft Scripting Component make this very easy to do.

Assuming you have to use Java for some reason, interfacing to COM from JNI is completely possible - though if you are not THOROUGHLY familiar with COM its best you try to use some kind of tool.

There are a couple of commercial products for accessing COM objects from Java, but you might want to start with a free tool from IBM''s Alphaworks that will provide for most of the functionality you would need to use Java as a scripting language in VB. It is called Bridge2Java and you can find out more information from http://alphaworks.ibm.com/tech/bridge2java .

Another route would be to use Microsoft’s Java tools (including J++). Java classes are COM accessible under the Microsoft JVM, and tools included with The Microsoft Java SDK and J++ facilitate COM to Java usage under various circumstances (including using Java objects in MTS). This path to using Java and VB might be most straightforward, but it comes with a list of ‘gotchas’. One is that Microsoft’s SDK only supports up to Java 1.1.

Some others from the FAQ - “there may be some doubt as to Microsoft''s commitment to continuing J++. There have been a lot of editorials in trade magazines declaring J++ all but dead. A few weeks ago Microsoft released a great deal of information about the next version of Visual Studio and I did not see one mention of J++. There haven''t been any significant J++ news releases in well over a year. Microsoft has also stated that they do not intend on releasing Java bindings to DirectX 7.0. The latest release of DirectX with Java support was DirectX 3.0.”
Thanks for the reply.

So, the next logical question is, as I have been pounding the streets looking for good "scripting" systems to use is....

What about Python?? I know, not a python message board. Or, to get back on topic, JPython??

As to the other things mentioned, do you have any, or anyone else for that matter, resource links/info on using VBscript via VB?? That is prolly a no-brainer, as the web more than likely has a ton, I''ll go hunting.

I am just thinking of possibilities and intergration techniques really. I am building two engines, side-by-side, one in VB one in C++. Call me crazy, what a hobby.

"Five passengers set sail that day, for a three hour tour, a three hour tour...."
JPython on it''s own right now is kinda shaky. There hasn''t been any official work in a while because of ownership disputes with some big corp. I would suggest you look at IBM''s BSF (http://oss.software.ibm.com/developerworks/opensource/bsf/). If you want to use scripting languages in Java then that is the way to go. If you want to use Java to script components of another language, you will have to use some form of a native interface.

This topic is closed to new replies.

Advertisement