Anyone out here any good with VBScript and Java? I need to pass text strings
to a program that is written in Java. Any way to call a method in Java from
VBScript? I know it can be done with VB Code but I don't know that much
about Java.

Bernie

Re: Pass Text to Java Program by mr_unreliable

mr_unreliable
Tue Nov 08 11:51:18 CST 2005

hi Bernie,

Could you tell us a little more about how the java program
expects to see the text?

For example, does the java program display a window, and ask
you to type in the text?

Or, does the java program expect you to give it a text file?

Or, maybe a database file?

Ask a better question -- get a better answer.

cheers, jw



Bernie Hunt wrote:
> Anyone out here any good with VBScript and Java? I need to pass text strings
> to a program that is written in Java. Any way to call a method in Java from
> VBScript? I know it can be done with VB Code but I don't know that much
> about Java.
>
> Bernie
>
>

Re: Pass Text to Java Program by Bernie

Bernie
Tue Nov 08 13:58:40 CST 2005

JW,

The java app belongs to the user. It can be modified, so I can somewhat
dictate what is needed. The applicaiton is to pass a status message to their
application and have it store it in their log. Obviously I could write the
message to a file and have their app pick up the message when they see the
file exits, but I was hoping for a direct call to the java app, like you can
call into an OCX.

Bernie

"mr_unreliable" <kindlyReplyToNewsgroup@notmail.com> wrote in message
news:%2375CIuI5FHA.3292@tk2msftngp13.phx.gbl...
> hi Bernie,
>
> Could you tell us a little more about how the java program
> expects to see the text?
>
> For example, does the java program display a window, and ask
> you to type in the text?
>
> Or, does the java program expect you to give it a text file?
>
> Or, maybe a database file?
>
> Ask a better question -- get a better answer.
>
> cheers, jw
>
>
>
> Bernie Hunt wrote:
>> Anyone out here any good with VBScript and Java? I need to pass text
>> strings to a program that is written in Java. Any way to call a method in
>> Java from VBScript? I know it can be done with VB Code but I don't know
>> that much about Java.
>>
>> Bernie
>>


Re: Pass Text to Java Program by mr_unreliable

mr_unreliable
Wed Nov 09 17:29:26 CST 2005

hi Bernie,

O.K., so you don't want to use a file.

When you say "direct call" as with an ocx, you are talking "COM"
(Component Object Model), the latest Microsoft hot technology,
that is until the net framework came along.

afaik, Java doesn't support com interfaces directly, but if you
google on it, you will find 3rd-party software packages that do
provide for "interoperability" -- i.e., that allow for adding
com-compliant interfaces to java programs.

Here are just the first two candidates that cropped up.

J-Integra for COM, (purchased software), found here:

http://j-integra.intrinsyc.com/products/java_com.asp

And, "The JACOB Project: A JAva-COM Bridge" (available from
Source Forge, and so apparently freeware), found here:

http://danadler.com/jacob/

There are probably others.

cheers, jw

p.s. My own favorite "trick" when dealing with a non-COM app
(such as a mini-app written in AutoIt) is to simply present a
textbox on the main form/window of the app, and then use
sendkeys (or something similiar, like cut-and-paste) to enter
text in the non-COM app's textbox. Then the non-COM app is
programmed to look in its textbox for messages from me.

Another "trick" that is used sometimes is to simply call the
app, with the text message as a parameter. Like this:

NONCOM.EXE /M:"This is a text message"

Some languages have a "previous instance" capability (vb has it).
The noncom app is programmed to test for a previous instance
of itself running. If there is a previous instance, it will just
pass along the parameter (the text message) to the previous
instance, using whatever native capabilities that language has
for passing along data. For example, the "SendData" api call.
This could continue indefinitely, i.e., you could just keep
passing messages this way. The receiving app would be programmed
to keep handling your messages until something like "QUIT" or
"EXIT" shows up.

Then there is DDE (Dynamic Data Exchange), which was Microsoft's
latest hot technology before COM came along, but is still
supported.

I could go on-and-on, but the dinner bell is ringing.


Bernie Hunt wrote:
> JW,
>
> The java app belongs to the user. It can be modified, so I can somewhat
> dictate what is needed. The applicaiton is to pass a status message to their
> application and have it store it in their log. Obviously I could write the
> message to a file and have their app pick up the message when they see the
> file exits, but I was hoping for a direct call to the java app, like you can
> call into an OCX.
>
> Bernie

Re: Pass Text to Java Program by Bernie

Bernie
Wed Nov 09 23:25:59 CST 2005

Thanks JW!


"mr_unreliable" <kindlyReplyToNewsgroup@notmail.com> wrote in message
news:ep$eqPY5FHA.2916@TK2MSFTNGP11.phx.gbl...
> hi Bernie,
>
> O.K., so you don't want to use a file.
>
> When you say "direct call" as with an ocx, you are talking "COM"
> (Component Object Model), the latest Microsoft hot technology,
> that is until the net framework came along.
>
> afaik, Java doesn't support com interfaces directly, but if you
> google on it, you will find 3rd-party software packages that do
> provide for "interoperability" -- i.e., that allow for adding
> com-compliant interfaces to java programs.
>
> Here are just the first two candidates that cropped up.
>
> J-Integra for COM, (purchased software), found here:
>
> http://j-integra.intrinsyc.com/products/java_com.asp
>
> And, "The JACOB Project: A JAva-COM Bridge" (available from
> Source Forge, and so apparently freeware), found here:
>
> http://danadler.com/jacob/
>
> There are probably others.
>
> cheers, jw
>
> p.s. My own favorite "trick" when dealing with a non-COM app
> (such as a mini-app written in AutoIt) is to simply present a
> textbox on the main form/window of the app, and then use
> sendkeys (or something similiar, like cut-and-paste) to enter
> text in the non-COM app's textbox. Then the non-COM app is
> programmed to look in its textbox for messages from me.
>
> Another "trick" that is used sometimes is to simply call the
> app, with the text message as a parameter. Like this:
>
> NONCOM.EXE /M:"This is a text message"
>
> Some languages have a "previous instance" capability (vb has it).
> The noncom app is programmed to test for a previous instance
> of itself running. If there is a previous instance, it will just
> pass along the parameter (the text message) to the previous
> instance, using whatever native capabilities that language has
> for passing along data. For example, the "SendData" api call.
> This could continue indefinitely, i.e., you could just keep
> passing messages this way. The receiving app would be programmed
> to keep handling your messages until something like "QUIT" or
> "EXIT" shows up.
>
> Then there is DDE (Dynamic Data Exchange), which was Microsoft's
> latest hot technology before COM came along, but is still
> supported.
>
> I could go on-and-on, but the dinner bell is ringing.
>
>
> Bernie Hunt wrote:
>> JW,
>>
>> The java app belongs to the user. It can be modified, so I can somewhat
>> dictate what is needed. The applicaiton is to pass a status message to
>> their application and have it store it in their log. Obviously I could
>> write the message to a file and have their app pick up the message when
>> they see the file exits, but I was hoping for a direct call to the java
>> app, like you can call into an OCX.
>>
>> Bernie



Re: Pass Text to Java Program by j-integra_support

j-integra_support
Thu Nov 10 10:31:55 CST 2005

You can find a number of "VBScript calling Java" examples in the
J-Integra documentation here...
http://j-integra.intrinsyc.com/support/com/doc/#asp_java/ASP_Introduction.html

Shane Sauer
J-Integra Interoperability Solutions
http://j-integra.intrinsyc.com/
high performance interop middleware for java, corba, com & .net