Can Java interface to standard Microsoft COM?

P

Peter Olcott

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?
 
L

Luc The Perverse

Peter Olcott said:
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)
 
J

Jean-Francois Briere

Peter said:
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
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Peter said:
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
 
G

Greg R. Broderick

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 (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 

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,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top