Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling a Java Method from Visual Basic 6

Tags:

java

vb6

I need to use a java class from visual basic 6. How should I declare the java class? I need to recieve 4 Strings, how do I recieve them? How do I call this class from Visual Basic 6? How should I handle the return value?

As you realize I am quite new with this and would appreciate your help.

like image 925
user1084509 Avatar asked Nov 04 '22 09:11

user1084509


1 Answers

I am sure there is a better way, but you can call the Java program on the command line

java -cp {class-path} TheNameOfYourClass arg1 arg2 arg3 arg4

You can get the return value from the output of the program.

e.g.

class TheNameOfYourClass {
    public static void mains(String... args) {
        System.out.println(Arrays.toString(args));
    }
}

if you run with arg1 arg2 arg3 arg4 it will print

[arg1,arg2,arg3,arg4]
like image 66
Peter Lawrey Avatar answered Nov 12 '22 22:11

Peter Lawrey