?
Solved

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

Posted on 2004-09-28
4
Medium Priority
?
143 Views
Last Modified: 2013-11-25
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
Comment
Question by:seckel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12168981
0
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 12173535
Java Application?  Not Java Applet?  Just use shell with the appropriate command line, e.g. "Java MyJavaApp" with whatever parameters & switches you need.
0
 

Author Comment

by:seckel
ID: 12178672
I need to know how to execute a Java component (not a application or applet).  
0
 
LVL 15

Accepted Solution

by:
babuno5 earned 1500 total points
ID: 12229233
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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question