Java Beans

Is it possible to use a JavaBean in a C++ application?
Do you know where I can get an example?
joegoodAsked:
Who is Participating?
 
prashant_n_mhatreConnect With a Mentor Commented:
You can always use interfaces (public methods) but on
unix platform (gcc compiler - I know..others I do not) it is partially supported.

Have a look at
http://gcc.gnu.org/ml/gcc-patches/2001-03/msg01483.html

for detailed information.
0
 
prashant_n_mhatreCommented:


There tools to package existing C++ objects as Java Beans and vice versa (the code is compiled as a dynamic link library (dll))

like

(1) VisualAge for Java C++ Access Builder

http://www7.software.ibm.com/vad.nsf/data/document2453?OpenDocument&p=1&BCT

(2) cxxwrap
http://www.execpc.com/~deaven/Dave/Software/cxxwrap/

You may use them.
0
 
joegoodAuthor Commented:
can you also use these C++ JavaBeans in Unix? (shared object library)

can you use a JavaBean in a C++ application?
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
prashant_n_mhatreCommented:
cxxwrap is supported on Unix platform also. VisualAge ?...I have no idea. I never used it but my friends don't talk in favor of it.

Vice versa should not be a problem.
0
 
joegoodAuthor Commented:
can you also use these C++ JavaBeans in Unix? (shared object library)

can you use a JavaBean in a C++ application?
0
 
joegoodAuthor Commented:
One last question and then I will give you the 300 points.
Can you treat these JavaBeans like objects?

Example
class Foo
{
  Foo();

  void Fx() { cout << "fx" << endl; };
  void Fy() { cout << "fy" << endl; };

};

can I use this class as an object in Java?

Example:
Foo foo;
foo.Fx();
foo.Fy();

Can I use a Java class/object in C++?

Thanks for your help and I promise to give you the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.