Solved

Java Beans

Posted on 2001-06-19
6
201 Views
Last Modified: 2010-04-17
Is it possible to use a JavaBean in a C++ application?
Do you know where I can get an example?
0
Comment
Question by:joegood
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:prashant_n_mhatre
ID: 6208340


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
 

Author Comment

by:joegood
ID: 6208359
can you also use these C++ JavaBeans in Unix? (shared object library)

can you use a JavaBean in a C++ application?
0
 
LVL 4

Expert Comment

by:prashant_n_mhatre
ID: 6208371
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:joegood
ID: 6208392
can you also use these C++ JavaBeans in Unix? (shared object library)

can you use a JavaBean in a C++ application?
0
 

Author Comment

by:joegood
ID: 6208400
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
 
LVL 4

Accepted Solution

by:
prashant_n_mhatre earned 300 total points
ID: 6208430
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

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
This is about my first experience with programming Arduino.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question