Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java and c

Reply
Thread Tools

java and c

 
 
focode
Guest
Posts: n/a
 
      04-21-2007
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

 
Reply With Quote
 
 
 
 
hellovinu@gmail.com
Guest
Posts: n/a
 
      04-21-2007
On Apr 21, 4:16 pm, focode <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
 
 
 
Philipp Leitner
Guest
Posts: n/a
 
      04-21-2007
On Apr 21, 1:16 pm, focode <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
Oliver Wong
Guest
Posts: n/a
 
      04-26-2007
"focode" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>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


 
Reply With Quote
 
Martin Gregorie
Guest
Posts: n/a
 
      04-26-2007
Oliver Wong wrote:
> "focode" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>> 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.
>

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.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot Requirements: 1.Sr Java Developer,2.Java Developer (Java with EJB) Isaac Java 0 01-20-2011 08:41 PM
hey i am just started java,, can anyone tell me the use ,application, why java , importance of java.. manish sahu Java 3 02-14-2008 12:00 AM
Another Question: Java and other application, Java and hardware Roberto Faenza Java 4 02-25-2007 06:18 PM
[JAVA] [EVALUATION] - The Java Failure (Sorry: The Java(tm) Failure) Ilias Lazaridis Java 0 02-01-2005 10:32 AM
Job to convert Java App 1.3.1 to Java Newest of Java Michael Kintner Java 0 11-30-2003 04:42 AM



Advertisments