wood burning stoves*
The moose likes Java in General and the fly likes Callig Java Methods from Visual Basic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Callig Java Methods from Visual Basic" Watch "Callig Java Methods from Visual Basic" New topic
Author

Callig Java Methods from Visual Basic

Francisco I
Ranch Hand

Joined: Mar 27, 2001
Posts: 44
Hello. I have an application in java that I want to integrate with another application which was done in VB. How can VB call a java method and receive the returning result?.
Another alternative to this is: How can I create a DLL out of a java class?
Thanks!
Francisco.
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
You can't directly call the VB methods instead try using APACHE SOAP.


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Tony Karas
Greenhorn

Joined: Jun 19, 2001
Posts: 6
If you are running windows and using Visual J++ - you can create COM DLLs using ms java (or at least you could a while back - not sure what has happened with the law suit and stuff).
You can run these dlls under Microsoft Transaction Server (or not) and call them from vb using CreateObject (I think - the details are slightly hazy).
Check out msdn on microsoft, but I'm sure it's possible.
Sorry for the slightly fuzzy details but it was a while ago.
Tony
Helmut Lerch
Ranch Hand

Joined: Feb 11, 2001
Posts: 48
Hi,
Originally posted by Francisco Iacobelli:
Hello. I have an application in java that I want to integrate with another application which was done in VB. How can VB call a java method and receive the returning result?.
Another alternative to this is: How can I create a DLL out of a java class?
Thanks!
Francisco.

There is another way for calling java methods from within VB. I never did it on my own I just read about it.
Take a look at:
http://java.sun.com/products/javabeans/software/bridge/
or search for ActiveX on java.sun.com.
sharan basu
Greenhorn

Joined: Feb 05, 2001
Posts: 12
hi,
This document contains details regarding the VBScript files execution with Windows Script Engine (WSE). Access the Java Objects in VBScripts or VB.
VBScript can use the java objects (applet or java beans) using GetObject() function by Instantiate Java object via moniker.

Installation Requirements:
Download the windows script host .exe file from the Microsoft site & Install it.
URL is: http://msdn.microsoft.com/scripting/default.htm?/scripting/vbscript/default.htm
Procedure:
We can run WSE either in desktop or in command line. For Desktop we have to run wscript.exe & for command line run cscript.exe which takes *.vbs(VBScript file) as the argument.
The java class file, which we are accessing in vbscript file, should be in the classpath.
The one more condition for java file is it has to have the Default constructor.
hope this may help u.

------------------
Mohamed Yousuff
Ranch Hand

Joined: Jun 23, 2001
Posts: 73

I would like to present my opinion on this. I think the solutions suggested may not be good since they are all platform dependent. Particularly when it comes to the case with two different applications written in two different languages, it is better we assume two different operating system also. Hence it would be better if CORBA is used to solve this problem.

Originally posted by Francisco Iacobelli:
Hello. I have an application in java that I want to integrate with another application which was done in VB. How can VB call a java method and receive the returning result?.
Another alternative to this is: How can I create a DLL out of a java class?
Thanks!
Francisco.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Callig Java Methods from Visual Basic
 
Similar Threads
Getting a return code from main
Application window focus
Calling vb component resides on windows from java on unix
Call Java web application from VB
VB interfacing with EJB