Can Java interface to standard Microsoft COM?

Discussion in 'Java' started by Peter Olcott, Aug 13, 2006.

  1. Peter Olcott

    Peter Olcott Guest

    Is it possible to write an application in C++, and enable this application to be
    used by Java as a component such as MS COM?
    Peter Olcott, Aug 13, 2006
    #1
    1. Advertising

  2. "Peter Olcott" <> wrote in message
    news:eek:JJDg.3822$uW1.2566@dukeread06...
    > Is it possible to write an application in C++, and enable this application
    > to be used by Java as a component such as MS COM?
    >


    Interfacing C++ and Java is possible using JNI (but does destroy system
    interoperability)

    Are you sure that you mean application? Typically one application would
    use components, or classes or functions. If you are writing two seperate
    applications then all you need to do is find a way for them to communicate.

    Incidentally, I originally came to this group asking the same question - and
    I eventually found that all the reasons that I wanted to use C++ from in
    Java were really not necessary - and soon thereafter Java became my favorite
    language. (I still struggle with a few n00bish things, but I feel I am
    fairly strong in the basics now.)

    In the case of an existing library (a DLL if you are on windows), JNI
    suddenly makes a lot of sense. Or if you need to do things which are not
    possible from Java, then you must use JNI (although be ready, JDK 1.6 is
    addressing many of the most common missing components including manipulating
    desktops, and utilizing system trays which were of principal interest to me)

    --
    LTP

    :)
    Luc The Perverse, Aug 13, 2006
    #2
    1. Advertising

  3. Peter Olcott wrote:
    > Is it possible to write an application in C++, and enable this application to be
    > used by Java as a component such as MS COM?


    If you build a DLL with exposed COM objects you can access them with a
    Java COM bridge.
    There are some bridges available, some free, some not free.

    My favorite bridge is free and is called JACOB:
    http://sourceforge.net/projects/jacob-project/

    Regards
    Jean-Francois Briere, Aug 13, 2006
    #3
  4. Peter Olcott wrote:
    > Is it possible to write an application in C++, and enable this application to be
    > used by Java as a component such as MS COM?


    The 10 year old MS Java actually has COM support builtin.

    For a non-antique standard compliant Java you will need
    to either get a product like:

    http://danadler.com/jacob/
    http://www.alphaworks.ibm.com/tech/dtjcb

    or write it yourself using JNI.

    Consider using either a proprietary
    protocol over plain sockets or standard
    SOAP/HTTP.

    Arne
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Aug 13, 2006
    #4
  5. "Peter Olcott" <> wrote in
    news:eek:JJDg.3822$uW1.2566@dukeread06:

    > Is it possible to write an application in C++, and enable this
    > application to be used by Java as a component such as MS COM?


    If you're thinking of using a COM control as a UI component in a Java
    application, then I doubt it would play well with awt, swing or spring.
    Otherwise, sure - see the advice that others have given.

    Cheers
    GRB


    --
    ---------------------------------------------------------------------
    Greg R. Broderick

    A. Top posters.
    Q. What is the most annoying thing on Usenet?
    ---------------------------------------------------------------------
    Greg R. Broderick, Aug 13, 2006
    #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. Charles A. Lackman
    Replies:
    1
    Views:
    1,330
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    533
    SpamProof
    Oct 21, 2003
  3. Xah Lee
    Replies:
    15
    Views:
    573
    Sherm Pendley
    Mar 23, 2007
  4. Xah Lee
    Replies:
    15
    Views:
    621
    Sherm Pendley
    Mar 23, 2007
  5. Xah Lee
    Replies:
    11
    Views:
    489
    Nigel Wade
    Mar 22, 2007
Loading...

Share This Page