java and c

Discussion in 'Java' started by focode, Apr 21, 2007.

  1. focode

    focode Guest

    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
    focode, Apr 21, 2007
    #1
    1. Advertising

  2. focode

    Guest

    On Apr 21, 4:16 pm, focode <> 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
    , Apr 21, 2007
    #2
    1. Advertising

  3. On Apr 21, 1:16 pm, focode <> 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
    Philipp Leitner, Apr 21, 2007
    #3
  4. focode

    Oliver Wong Guest

    "focode" <> wrote in message
    news:...
    >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
    Oliver Wong, Apr 26, 2007
    #4
  5. Oliver Wong wrote:
    > "focode" <> wrote in message
    > news:...
    >> 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 |
    Martin Gregorie, Apr 26, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Kintner
    Replies:
    0
    Views:
    839
    Michael Kintner
    Nov 30, 2003
  2. Ilias Lazaridis
    Replies:
    0
    Views:
    564
    Ilias Lazaridis
    Feb 1, 2005
  3. Roberto Faenza
    Replies:
    4
    Views:
    348
    Luc The Perverse
    Feb 25, 2007
  4. manish sahu
    Replies:
    3
    Views:
    993
  5. Isaac
    Replies:
    0
    Views:
    359
    Isaac
    Jan 20, 2011
Loading...

Share This Page