• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 147
  • Last Modified:

How do I execute a Java com from a VB app?

I have a Java com that I want to run from a VB application.  

How do I execute a Java com from a VB app?  Please show example...
0
seckel
Asked:
seckel
1 Solution
 
JohnBPriceCommented:
Java Application?  Not Java Applet?  Just use shell with the appropriate command line, e.g. "Java MyJavaApp" with whatever parameters & switches you need.
0
 
seckelAuthor Commented:
I need to know how to execute a Java component (not a application or applet).  
0
 
babuno5Commented:
well here is a sort of a demonstration to run any application or a  runtime component


Shell:  This is a very useful key word.  By use of the shell command, you can start other programs.  Look at this example:

Private lshell as long

Lshell = shell(“c:\path\name.exe”,1)

This tells the computer to take the path name and start the program “name.exe” in standard mode (1) and return its windows handle to the variable entitled lShell.

      Tip: You must use a long in 32 bit operating systems like Windows 95, 98, or NT because they return a long windows handle.  Windows 3.1 was 16 bit and returned an integer handle.


App.Activate:  This statement allows you to activate a program that is already running.  You can either, activate a program by using its name as it appears in the tool bar or by using the windows handle returned to lShell.

App.activate lshell

     Or

App.activate “MS Word”



Sendkeys:  After app.activate you can send keystrokes to a program.  For example if you have activated the notepad.exe you can then

Sendkeys “My Dog Has Fleas”

And that phrase will appear in the notepad!
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now