Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
As the title states, I am attempting to implement a C++ GUI into a Java application. I am using Eclipse editor for writing most of the code. The program was initially used with a Java GUI, but to make it easier for people to use I was given a C++ different GUI interface. The code is written for the GUI already. If anyone could give me a detailed answer on how to make the C++ GUI work with my Java program I would really appreciate it!

Well, off the top of my head, I can think of a few options.
1) Add command-line argument support and console output for your Java app, then have the C++ front-end run your Java app with the required arguments, then parse the output.2) Implement something like Named Pipes. (Bonus: link provides sample Java and C code.) When up and running, this would probably be faster than #1, but it requires more "things be broke" logic, and more cleanup.
3) Rewrite the C++ front-end in Java, and incorporate it into your Java app. It's probably what I'd lobby for, if just for the unified code base and simplified maintenance costs. It could also be the most expensive up front. Or it could not. I don't know; I'm obviously not involved with your project.
MSDN has some good reference into interprocess communications, but it deals with C/C++ and not Java. You might want to read it regardless.

Oh, wow, JNI. I completely forgot about that. Guess that shows how much I use Java. I'm told that it's a pain, though.

![]() |
Copy folders in a batch f...
|
PHP 5.2.5 Only 6.65 MB?
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |