java and c

F

focode

i have developed a program in turbo c3 which communicates with
parallel port of my pc , through which i am able to control the
working of some electrical appliances , i want to communicate with
that program from my java program , how can this be made possible ?
If any one can help me , plz
 
H

hellovinu

i have developed a program in turbo c3 which communicates with
parallel port of my pc , through which i am able to control the
working of some electrical appliances , i want to communicate with
that program from my java program , how can this be made possible ?
If any one can help me , plz

in java you can us ethe package javax.comm ,but you have to download
it from sun.com
 
P

Philipp Leitner

i want to communicate with
that program from my java program , how can this be made possible ?
If any one can help me , plz

You can use JNI (Java Native Interface) to communicate with C(++)
applications. Look at java.sun.com, there's a good JNI tutorial
available.

/philipp
 
O

Oliver Wong

focode said:
i have developed a program in turbo c3 which communicates with
parallel port of my pc , through which i am able to control the
working of some electrical appliances , i want to communicate with
that program from my java program , how can this be made possible ?
If any one can help me , plz

It depends on the interface that your C program exposes. If your C
program can communicate via stdio, you could have your Java program talk
to it that way. If your C program monitors a specific directory for files,
your Java program may be able to communicate by producing the appropriate
files. If your C program listens on a socket, your Java program can
communicate with it via sockets.

- Oliver
 
M

Martin Gregorie

Oliver said:
It depends on the interface that your C program exposes. If your C
program can communicate via stdio, you could have your Java program talk
to it that way. If your C program monitors a specific directory for files,
your Java program may be able to communicate by producing the appropriate
files. If your C program listens on a socket, your Java program can
communicate with it via sockets.
The OP mentions Turbo C 3, so presumably that's Borland C. Borland C
4.5 didn't include either sockets or poll() in the standard C library. I
speak ANSI C, not C++ so can't tell whether the C++ classes might
support sockets: however as "sockets" doesn't appear in any
documentation indexes my guess is that it doesn't, so version 3 won't
either.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top